[ 3.5.y.z extended stable ] Patch "fuse: don't WARN when nlink is zero" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Tue Mar 5 18:51:31 UTC 2013

This is a note to let you know that I have just added a patch titled

    fuse: don't WARN when nlink is zero

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



>From edeec2eb7d5af46347c36f050a6d282deb7ce132 Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <mszeredi at suse.cz>
Date: Mon, 4 Feb 2013 15:57:42 +0100
Subject: [PATCH] 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 at gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi at suse.cz>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
 fs/fuse/dir.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 334e0b1..f6e4bc8 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)

 		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);

More information about the kernel-team mailing list