On Thu, 3 Nov 2011, Barry Song wrote: > > Adding the fsync() in do_prevent_allow() make the code more robust > > and friendly > > for final user, if not, it might not be one issue for one self-powered system. > > yes, agree. it is more robust:-) > > but being not that robust is not a problem. the idea of page cache has > been not that robust as people don't do sync after writing file every > time. > > So keep system robust is the job of > 1. poweroff the machine, which will do sync[1] > 2. umount and eject the disk [2] > > the page cache flushing operations is the job of > 1. pdflush on demand > 2. the above [1][2] > > but it is not bad for usb gadget to do fsync to the file it uses while > it wants to close it. That's right. The problem is that the user can't tell when "pdflush on demand" is finished, which means the user would have to do a manual "sync" before removing the medium (in the case where the backing storage is a block device). It's better for the gadget to take care of this automatically. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html