Re: [PATCH 04/14] btrfs-progs: don't leak fd in get_fs_info

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

 



On 3/5/13 5:41 PM, Eric Sandeen wrote:
> On 3/4/13 4:39 PM, Eric Sandeen wrote:
>> If we discover that a passed-in fd is not a mountpoint,
>> we determine whether it is a device, and issue another
>> open() against the device's mount point if it is mounted.
>>
>> If we do so, ensure this 2nd fd gets closed before we return
>> so that it does not leak, by consolidating error returns.
>>
>> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> 
> Gah, self-nak on this for now, I started trying to make a
> regression test for scrub, and this makes it fail.
> 
> Don't know why yet.
> 
> -Eric

For posterity, it's because this function is actually
doing kind of a nasty thing - it closes the caller's
filehandle & re-opens it on a different path.

Usually the caller is none the wiser, but ick!  So permanent
NAK on this patch, I'm working on a different solution.

-Eric
--
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