mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <ore@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	Oleksij Rempel <o.rempel@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] usb: fastboot: umount device before writing to it
Date: Fri, 10 Mar 2017 10:14:46 +0100	[thread overview]
Message-ID: <3f45900f-b45b-a6d0-86c2-919056b25137@pengutronix.de> (raw)
In-Reply-To: <20170310073258.nahg4i2wmcrni5s2@pengutronix.de>



On 03/10/2017 08:32 AM, Sascha Hauer wrote:
> On Wed, Mar 08, 2017 at 10:24:02AM +0100, Oleksij Rempel wrote:
>> From: Sascha Hauer <s.hauer@pengutronix.de>
>>
>> When a fastboot target refers to a device and we are going to write
>> to it, umount it beforehand, so that we do not end up with corrupt
>> data after writing.
>>
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>> ---
>>  drivers/usb/gadget/f_fastboot.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
>> index a6192b9eb..8d69aea8b 100644
>> --- a/drivers/usb/gadget/f_fastboot.c
>> +++ b/drivers/usb/gadget/f_fastboot.c
>> @@ -754,6 +754,7 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req, const char *cmd
>>  		goto out;
>>  	}
>>
>> +	umount(filename);
>
> I'm not sure about this one. We should probably rather bail out with an
> error when it's mounted. When it's mounted then the result is undesired,
> even when we unmount it before flashing.

hm... for this case we will probably need some function to check if 
device is mounted. something like: is_mounted(path). Or, is there some 
other way to do this?



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-03-10  9:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08  9:24 [PATCH 1/2] bbu: Search for cdev names aswell Oleksij Rempel
2017-03-08  9:24 ` [PATCH 2/2] usb: fastboot: umount device before writing to it Oleksij Rempel
2017-03-10  7:32   ` Sascha Hauer
2017-03-10  9:14     ` Oleksij Rempel [this message]
2017-03-10  9:17       ` 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=3f45900f-b45b-a6d0-86c2-919056b25137@pengutronix.de \
    --to=ore@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=o.rempel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    /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