Hi, On Thu, Oct 27, 2011 at 12:40:34PM -0700, Paul Zimmerman wrote: > > -----Original Message----- > > From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Alan Stern > > Sent: Thursday, October 27, 2011 9:05 AM > > > > On Thu, 27 Oct 2011, Barry Song wrote: > > > > > > Did you understand when I said that closing the backing file would > > > > flush the page cache if the backing file is a device? > > > > > > that is not important. my point is we can just think this gadget as an > > > user to vfs on target board, actually it is. > > > so there is no any necessarity to do any fsync at all. > > > > > > when target board is disconnected from pc, pc has the duty to do the > > > fsync to this gadget. > > > > And yet Windows doesn't seem to do this. Which means the gadget driver > > has to take responsibility. > > I'm pretty sure Windows assumes that once a write to a removable device > completes, the data is safe. Most Windows users don't bother to "safely > eject" a thumb drive, they just yank it once the transfer is shown as > complete. That's configurable. You can optimize for performance - which will do asynchronous writes - or you can optimize for removal - which will all SCSI Writes to be synchronous. Commit a93917d39fc388c4761d2530af82513e2d3bf9f6 added a module parameter to ignore the FUA bit. The point is, if FUA is set and all writes are synchronous already, do we need to fsync() again ? -- balbi
Attachment:
signature.asc
Description: Digital signature