RE: FW: Concerns regarding file backed storage gadget

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

 



Thank you for your quick replies.  Since I received Greg's reply first, I started my reply aimed at his question.

> Yes, your client can change the file, but the issue is if another
> process makes changes to the filesystem at the same time.  Then the
> client will not notice these changes and bad things can happen.
> Have you tried this?

Yes, we have done extensive testing in this area and have things working well.  Just to clarify, we are considering the USB client as the Linux device which has the backing file and the USB host as the PC (Windows).

During the initial development, we did run into "cache coherency"-like issues in Windows.  We found that if we changed the contents of the backing file from the client, the host (Windows) would never read the new data.  However, we found that in Windows, if we opened the file with the FILE_FLAG_NO_BUFFERING attribute set, Windows would always read (and write) the latest data from (or to) the device (instead of its local cache).

The mechanism works as follows:
We have set aside a 512kb portion of the backing file as a ring buffered transfer area which is split into buffers for host to client writes and client to host writes.  Again, all host reads/writes are non-cached.  When the host wants to transfer some data, if first does a read of the host to client ring buffer index and then performs writes to the currently unused ring buffers.  The opposite works for client to host.

We've tested this functionality on a few Windows 7 and XP systems and haven't seen any issues yet.

Given all this, is there any reason to believe there could be a possibility of stability issues on either side (PC or Linux)?

Thanks,
Rob


-----Original Message-----
From: Greg KH [mailto:greg@xxxxxxxxx] 
Sent: Thursday, August 19, 2010 12:53 PM
To: Murphy, Robert
Cc: linux-usb@xxxxxxxxxxxxxxx
Subject: Re: FW: Concerns regarding file backed storage gadget

On Thu, Aug 19, 2010 at 10:17:28AM -0700, Murphy, Robert wrote:
> We are using the file backed storage gadget as the basis of a software
> mechanism for allowing inter-device communication between a Windows
> host and Linux client device.  Recently we have become concerned
> regarding the notice of possible stability issues with the host OS if
> the backing file changes without the host OS having made the change
> (see section "AN IMPORTANT WARNING"):
> http://www.linux-usb.org/gadget/file_storage.html
> 
> So far, we have not experienced any issues with having our Linux
> client device changing the contents of a file in the backing file.

Yes, your client can change the file, but the issue is if another
process makes changes to the filesystem at the same time.  Then the
client will not notice these changes and bad things can happen.

Have you tried this?

thanks,

greg k-h
--
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