Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfca7ceb authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

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: default avatarTero Roponen <tero.roponen@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
parent 6a4e922c
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -705,6 +705,13 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)

		spin_lock(&fc->lock);
		fi->attr_version = ++fc->attr_version;
		/*
		 * 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);
		fuse_invalidate_attr(inode);