From patchwork Tue Sep 25 05:27:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 1501871 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 761B8DF28C for ; Tue, 25 Sep 2012 05:27:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752770Ab2IYF1j (ORCPT ); Tue, 25 Sep 2012 01:27:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34163 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752208Ab2IYF1i (ORCPT ); Tue, 25 Sep 2012 01:27:38 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 10FC4A329B; Tue, 25 Sep 2012 07:27:37 +0200 (CEST) Date: Tue, 25 Sep 2012 15:27:31 +1000 From: NeilBrown To: Jeff Layton Cc: "Myklebust, Trond" , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: WARNING: at fs/inode.c:280 drop_nlink+0x31/0x33() Message-ID: <20120925152731.52528dca@notabene.brown> In-Reply-To: <20120829151641.20cde4bc@corrin.poochiereds.net> References: <20120829162527.GA3635@NickAndBarb.net> <20120829151641.20cde4bc@corrin.poochiereds.net> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.7; x86_64-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 29 Aug 2012 15:16:41 -0700 Jeff Layton wrote: > This stack trace comes from cifs, not nfs. It's quite easy to trigger on NFS too. mount server:/path /mnt; exec 3>& /mnt/foo ; rm /mnt/foo; rm /mnt/.nfs* ; exec 3>&- [634155.004438] WARNING: at /home/abuild/rpmbuild/BUILD/kernel-desktop-3.5.0/lin [634155.004442] Hardware name: Latitude E6510 [634155.004577] crc_itu_t crc32c_intel snd_hwdep snd_pcm snd_timer snd soundcor [634155.004609] Pid: 13402, comm: bash Tainted: G W 3.5.0-36-desktop # [634155.004611] Call Trace: [634155.004630] [] dump_trace+0xaa/0x2b0 [634155.004641] [] dump_stack+0x69/0x6f [634155.004653] [] warn_slowpath_common+0x7b/0xc0 [634155.004662] [] drop_nlink+0x34/0x40 [634155.004687] [] nfs_dentry_iput+0x33/0x70 [nfs] [634155.004714] [] dput+0x12e/0x230 [634155.004726] [] __fput+0x170/0x230 [634155.004735] [] filp_close+0x5f/0x90 [634155.004743] [] sys_close+0x97/0x100 [634155.004754] [] system_call_fastpath+0x16/0x1b [634155.004767] [<00007f2a73a0d110>] 0x7f2a73a0d10f Is this suitable for -stable? It seems like it is just a harmless warning. NeilBrown Subject: NFS: avoid warning from nfs_drop_nlink If you remove a file which is open, NFS will 'silly-rename' it to a hidden file. If you then remove that hidden file, and then close the open file, then nfs_dentry_iput will perform an extra drop_nlink(). Since 3.3-rc1, this has produced a warning. The simplest way to suppress it is to use "nfs_drop_nlink" which checks for i_nlink being zero. Signed-off-by: NeilBrown Reviewed-by: Jeff Layton diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 627f108..268af03 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1174,7 +1174,7 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode) NFS_I(inode)->cache_validity |= NFS_INO_INVALID_DATA; if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { - drop_nlink(inode); + nfs_drop_nlink(inode); nfs_complete_unlink(dentry, inode); } iput(inode);