Re: usb-storage: fsync() take too much time when handing ALLOW_MEDIUM_REMOVAL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 28 Oct 2011, Alan Stern wrote:

> The important questions are:
> 
> 	When are the right times to flush the page cache?
> 
> 	Why should the MSC gadget have to worry about this in the
> 	first place?  That is, why doesn't the rest of the kernel
> 	take care of this automatically?

I just went back and looked at the SCSI spec.  The description of START 
STOP UNIT says this:

	Targets that contain cache memory shall implicitly perform a 
	SYNCHRONIZE CACHE command for the entire medium prior to 
	executing the STOP UNIT command.

That's pretty clear.  Currently the do_start_stop() routine just calls
fsg_lun_close(); it looks like we should put an fsg_lun_fsync_sub()  
call there too if the backing storage is not a regular file (and maybe
even if it _is_ a regular file, if we want to obey the spec strictly).

Then there won't be any need for fsg_lun_fsync_sub() in
do_prevent_allow().

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux