Re: [PATCH] fs: Detect API misuse of i_op->lookup

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

 



Am 25.01.2015 um 23:16 schrieb Al Viro:
> On Sun, Jan 25, 2015 at 10:57:40PM +0100, Richard Weinberger wrote:
>> Hunting down a refcount issue in an out-of-tree filesystem uncovered
>> that its lookup function directly returned the dentry which was passed to it.
>> Add a BUG_ON() to detect such misuse in future.
> 
> In principle, it's not a bug.  You *must* grab a reference to dentry before
> returning it, but you can very well decide to return the one you've got -
> any place where have ->lookup() return NULL has every right to become
> return dget(dentry).

Thanks for the clarification! The filesystem in question did of course
not grab a reference before returning the same dentry.

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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux