From: Antony Pavlov <antonynpavlov@gmail.com>
To: Peter Mamonov <pmamonov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] common: filetype: do not redetect MBR-type devices as a FAT-type
Date: Mon, 9 Nov 2015 14:18:36 +0300 [thread overview]
Message-ID: <20151109141836.d4ac2cd5243ef443883fabde@gmail.com> (raw)
In-Reply-To: <1447065171-31571-1-git-send-email-pmamonov@gmail.com>
On Mon, 9 Nov 2015 13:32:51 +0300
Peter Mamonov <pmamonov@gmail.com> wrote:
> Deleted pieces of code detect MBR-containig device as a FAT-type device,
> if it's first partition contains a FAT filesystem. This behaviour enabled one
> to mount the FAT FS which is either directly on the device (disk0) or on
> the first partition (disk0.0) using the same command:
> mount /dev/disk0 /fat
> However, the desired behaviour can be reached with a:
> mount /dev/disk0 /fat || mount /dev/disk0.0 /fat || echo "Mounting failed"
>
> Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
^^^^^^^^^^
Ad memorandum. Sascha's ack can be found here: http://lists.infradead.org/pipermail/barebox/2015-October/024952.html
> ---
> common/filetype.c | 30 ------------------------------
> 1 file changed, 30 deletions(-)
>
> diff --git a/common/filetype.c b/common/filetype.c
> index c59441d..f9e03f7 100644
> --- a/common/filetype.c
> +++ b/common/filetype.c
> @@ -345,21 +345,6 @@ enum filetype file_name_detect_type(const char *filename)
>
> type = file_detect_type(buf, ret);
>
> - if (type == filetype_mbr) {
> - /*
> - * Get the first partition start sector
> - * and check for FAT in it
> - */
> - is_fat_or_mbr(buf, &bootsec);
> - ret = lseek(fd, (bootsec) * 512, SEEK_SET);
> - if (ret < 0)
> - goto err_out;
> - ret = read(fd, buf, 512);
> - if (ret < 0)
> - goto err_out;
> - type = is_fat_or_mbr((u8 *)buf, NULL);
> - }
> -
> err_out:
> close(fd);
> free(buf);
> @@ -385,21 +370,6 @@ enum filetype cdev_detect_type(const char *name)
>
> type = file_detect_type(buf, ret);
>
> - if (type == filetype_mbr) {
> - unsigned long bootsec;
> - /*
> - * Get the first partition start sector
> - * and check for FAT in it
> - */
> - is_fat_or_mbr(buf, &bootsec);
> -
> - ret = cdev_read(cdev, buf, 512, bootsec * 512, 0);
> - if (ret < 0)
> - goto err_out;
> -
> - type = is_fat_or_mbr((u8 *)buf, NULL);
> - }
> -
> err_out:
> free(buf);
> cdev_close(cdev);
> --
> 2.1.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
--
Best regards,
Antony Pavlov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-11-09 10:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 10:32 Peter Mamonov
2015-11-09 11:18 ` Antony Pavlov [this message]
2015-11-09 18:49 ` Trent Piepho
2015-11-10 8:04 ` Sascha Hauer
2015-11-10 8:15 ` Sascha Hauer
2015-11-10 18:44 ` Trent Piepho
2015-11-11 7:35 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151109141836.d4ac2cd5243ef443883fabde@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=pmamonov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox