Re: gadgetfs: fops change not preserved on return from dev_config()

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

 



Hi,

On Mon, Oct 27, 2014 at 10:31:42AM +1100, Andre Wolokita wrote:
> I'm noticing some strange behaviour in the gadgetfs driver when
> running gadgetfs-test; the program fails with the error "ep0 read
> after poll: Invalid argument".
>
> As far as I understand, an inode is created upon an open() call in
> gadgetfs-test and an initial fops is assigned to the struct file that
> doesn't contain a .read member.
>
> The .write member of this first fops points to dev_config() in
> usb/gadget/legacy/inode.c. 
>
> When user-space write is called for the first time, dev_config()
> performs a bunch of configuration stuff before doing "fd->f_op =
> &ep0_io_operations;". This new file_operations struct does contain a
> .read member, which points to ep0_read().
> 
> I'm confused as to why when an error occurs when a subsequent read()
> is called in gadgetfs-test. I thought that changes to an fops pointer
> is preserved upon returning to the user-space caller. How can it be
> that "fd->f_op = &ep0_io_operations;" clearly changes the fops
> pointer, yet these changes aren't reflected when returning to
> user-space?

probably a regression caused by another commit ? Can you try bisecting
to pin-point what broke it ? Do you remember which was the last kernel
where this worked ?

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux