ubifs: ubifs_purge_xattrs() wrongly called

Richard Weinberger richard.weinberger at gmail.com
Thu Jan 21 03:43:22 EST 2021


Sascha,

On Wed, Jan 20, 2021 at 2:45 PM Sascha Hauer <sha at pengutronix.de> wrote:
>
> Hi All,
>
> I just noticed that ubifs_purge_xattrs() is wrongly called from
> ubifs_unlink() when a dentry is deleted. Deleting a dentry doesn't mean
> that the inode the xattrs are attached to is going away. Removing a file
> that has hardlinks will result in removing the xattrs when instead they
> should stay until the last link is removed.

you are right, that's a bug we need to address.

> ubifs_purge_xattrs() only removes the xattrs when their number exceeds
> ubifs_xattr_max_cnt(). Otherwise it does nothing, so it's unlikely to
> hit this bug in real life.

Yes. The idea is being able to remove inodes from old filesystems
where we didn't
had the limitation.

> I am not sure how to fix that. Maybe calling ubifs_purge_xattrs() from
> ubifs_evict_inode() would be correct, but I haven't looked deeper into
> this.

I can't remember right now why I didn't use the evict path.
Hmmm.

-- 
Thanks,
//richard



More information about the linux-mtd mailing list