Re: [PATCH] ubifs: ubifs_jnl_change_xattr: Remove assertion 'nlink > 0' for host inode

From: Richard Weinberger
Date: Sun Sep 13 2020 - 14:42:53 EST


On Mon, Aug 17, 2020 at 4:29 PM Zhihao Cheng <chengzhihao1@xxxxxxxxxx> wrote:
>
> Changing xattr of a temp file will trigger following assertion failed
> and make ubifs turn into readonly filesystem:
> ubifs_assert_failed [ubifs]: UBIFS assert failed: host->i_nlink > 0,
> in fs/ubifs/journal.c:1801
>
> Reproducer:
> 1. fd = open(__O_TMPFILE)
> 2. fsetxattr(fd, key, value2, XATTR_CREATE)
> 3. fsetxattr(fd, key, value2, XATTR_REPLACE)
>
> Fix this by removing assertion 'nlink > 0' for host inode.
>
> Reported-by: Chengsong Ke <kechengsong@xxxxxxxxxx>
> Signed-off-by: Zhihao Cheng <chengzhihao1@xxxxxxxxxx>

Applied to fixes, thanks!

--
Thanks,
//richard