Re: [PATCH] ubifs: Fix inode leak in xattr code

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

 



Artem,

Am 15.05.2017 um 16:53 schrieb Artem Bityutskiy:
> On Mon, 2017-05-15 at 16:20 +0200, Richard Weinberger wrote:
>> To solve this problem, set i_nlink for all xattr inodes to 0, such
>> that
>> the iput() in the UBIFS xattr code makes the temporary inode vanish
>> immediately.
> 
> What if there is iget right after iput? With this patch, will we need
> to go all the way to the slow media instead of just getting having the
> inode from the inode cache?

Hmm, why would we go down to the slow media?
Since the xattr was just looked up there is a high chance that the TNC
will still contain the node.
A new inode needs to be allocated, though.

Alternatively we could add a iget_locked/drop_nlink/iput sequence to
ubifs_tnc_remove_ino(). But that will make unlink() much slower for files
that contain xattrs.

Thanks,
//richard



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]