mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
fuse: don't WARN when nlink is zero
drop_nlink() warns if nlink is already zero. This is triggerable by a buggy userspace filesystem. The cure, I think, is worse than the disease so disable the warning. Reported-by: Tero Roponen <tero.roponen@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
This commit is contained in:
parent
6a4e922c3d
commit
dfca7cebc2
1 changed files with 8 additions and 1 deletions
|
@ -705,7 +705,14 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)
|
||||||
|
|
||||||
spin_lock(&fc->lock);
|
spin_lock(&fc->lock);
|
||||||
fi->attr_version = ++fc->attr_version;
|
fi->attr_version = ++fc->attr_version;
|
||||||
drop_nlink(inode);
|
/*
|
||||||
|
* If i_nlink == 0 then unlink doesn't make sense, yet this can
|
||||||
|
* happen if userspace filesystem is careless. It would be
|
||||||
|
* difficult to enforce correct nlink usage so just ignore this
|
||||||
|
* condition here
|
||||||
|
*/
|
||||||
|
if (inode->i_nlink > 0)
|
||||||
|
drop_nlink(inode);
|
||||||
spin_unlock(&fc->lock);
|
spin_unlock(&fc->lock);
|
||||||
fuse_invalidate_attr(inode);
|
fuse_invalidate_attr(inode);
|
||||||
fuse_invalidate_attr(dir);
|
fuse_invalidate_attr(dir);
|
||||||
|
|
Loading…
Reference in a new issue