diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2013-02-04 14:57:42 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-03 22:03:38 (GMT) |
commit | c205ae0e166fa0fdfdfb2cb55a4fc597b0dd68be (patch) | |
tree | 3d9475862551cd279ff623180f4e2a12ecb708a9 /fs/fuse/dir.c | |
parent | d62365d15278c2e3bdd17b413620264c74590ee6 (diff) | |
download | linux-fsl-qoriq-c205ae0e166fa0fdfdfb2cb55a4fc597b0dd68be.tar.xz |
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/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index b7c09f9..315e1f8 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -682,7 +682,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); |