From b8bb61922a97a9ec35695442aeb48cad6ea1bbbd Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 4 Feb 2013 15:57:42 +0100 Subject: [PATCH] --- yaml --- r: 352903 b: refs/heads/master c: dfca7cebc2679f3d129f8e680a8f199a7ad16e38 h: refs/heads/master i: 352901: 43bb98d5b5f641a255673272e9989c8dcb9effab 352899: 9acbcf6fa25084127fb86535beeed915359aceea 352895: e61a585d6015ec7b6c1d8cf5746a04aa3640d7de v: v3 --- [refs] | 2 +- trunk/fs/fuse/dir.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 80c0c3d3cd58..3fe39d7881ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6a4e922c3db06f7da27e072729e047185c2fba66 +refs/heads/master: dfca7cebc2679f3d129f8e680a8f199a7ad16e38 diff --git a/trunk/fs/fuse/dir.c b/trunk/fs/fuse/dir.c index dc5e64893375..2b112d978e9f 100644 --- a/trunk/fs/fuse/dir.c +++ b/trunk/fs/fuse/dir.c @@ -705,7 +705,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);