summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-02-04 15:57:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-04 06:06:43 +0800
commit146207bbadeb4578334d6e26b9b690df8aeb1a3d (patch)
treedbf8d2cbe783956cdd0310e28f6187f2e0e39186 /fs/fuse
parent94dcb26bbbed1851e0a7fb16165207c2c61e545f (diff)
downloadlinux-3.10-146207bbadeb4578334d6e26b9b690df8aeb1a3d.tar.gz
linux-3.10-146207bbadeb4578334d6e26b9b690df8aeb1a3d.tar.bz2
linux-3.10-146207bbadeb4578334d6e26b9b690df8aeb1a3d.zip
fuse: don't WARN when nlink is zero
commit dfca7cebc2679f3d129f8e680a8f199a7ad16e38 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dir.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index bc438320cac..d48478a864b 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -645,7 +645,14 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)
spin_lock(&fc->lock);
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);
fuse_invalidate_attr(inode);
fuse_invalidate_attr(dir);