Re: [PATCH] btrfs: Don't check for file->private_data on open(). It is set by the core.

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

 



Am 2014-11-12 um 18:59 schrieb Chris Mason:
> On Wed, Nov 12, 2014 at 11:38 AM, Martin Kepplinger <martink@xxxxxxxxx>
> wrote:
>> The miscdevice core now sets file->private_data to the struct miscdevice
>> so don't fail when this is not NULL.
>>
>> Signed-off-by: Martin Kepplinger <martink@xxxxxxxxx>
>> ---
>> This is a question: what does this check provide and does overwriting
>> file->private_data make any difference?
>>
>> Is miscdevice's open() by the user not allowed here, if
>> file->private_data
>> is set?
>>
>> thanks!!
> 
> Btrfs uses this in the transaction start ioctl to record the transaction
> handle being started.  Ceph is the main user of the ioctl, and we could
> setup a hash table if needed.  But which call path in miscdevice is
> doing this?
> 
> With your patch in place, btrfs would end up overwriting the miscdevice
> private_data field, which would probably cause problems.
> 
> -chris
> 

I think i was mistaken, sorry. misc_open() used to set
file->private_data _only_ if you use set .open in struct file_operations.

In current -next this changed and file->private_data is set to struct
miscdevice on a (userspace's) open call (misc_open()) just in any case.

You do set .open so this wouldn't affect you and this patch can be ignored.

                        martin
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux