Return-Path: linux-nfs-owner@vger.kernel.org Received: from mail-vc0-f170.google.com ([209.85.220.170]:33163 "EHLO mail-vc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753533AbaIHXy7 (ORCPT ); Mon, 8 Sep 2014 19:54:59 -0400 Received: by mail-vc0-f170.google.com with SMTP id hy4so1598249vcb.15 for ; Mon, 08 Sep 2014 16:54:58 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140828014123.GF18016@ZenIV.linux.org.uk> References: <1408217806-25877-1-git-send-email-xiyou.wangcong@gmail.com> <87ppfvrdux.fsf@x220.int.ebiederm.org> <20140828014123.GF18016@ZenIV.linux.org.uk> Date: Mon, 8 Sep 2014 16:54:57 -0700 Message-ID: Subject: Re: [PATCH v2] nfs: fix kernel warning when removing proc entry From: Trond Myklebust To: Al Viro Cc: "Eric W. Biederman" , Cong Wang , Linux Kernel mailing list , Linux NFS Mailing List , Dan Aloni Content-Type: multipart/mixed; boundary=089e0122a71ed81a550502968b44 Sender: linux-nfs-owner@vger.kernel.org List-ID: --089e0122a71ed81a550502968b44 Content-Type: text/plain; charset=UTF-8 On Wed, Aug 27, 2014 at 6:41 PM, Al Viro wrote: > On Tue, Aug 19, 2014 at 09:20:38PM -0700, Eric W. Biederman wrote: >> Cong Wang writes: >> >> > I saw the following kernel warning: >> >> Cong thanks for finding and tracking this. I was clearly asleep at the >> switch when I was testing my fix to the nfs client code :( >> >> I have applied this patch and will push it to Linus after it has a >> little bit to sit in linux-next. > > Why does that code wank with one-by-one remove_proc_entry(), BTW? > remove_proc_subtree("nfsfs", net->proc_net) will take care of the whole pile > just fine, TYVM... While we are it, there's no need to keep ->proc_nfsfs > at all - just have it in a local variable in nfs_fs_proc_net_init(). Since nobody sent me an updated version with the remove_proc_subtree fix, I went ahead and edited the patch myself (see attachment). Cong, please let me know if you disagree with that change, otherwise, that will be the final patch sent upstream and Cc: stable # 3.4+. I'll schedule cleanup patches to make the same changes to the original nfs_fs_proc_exit() and nfs_fs_proc_init() and to remove (struct nfs_net)->proc_nfsfs for merging in 3.18. -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.myklebust@primarydata.com --089e0122a71ed81a550502968b44 Content-Type: application/octet-stream; name="0001-nfs-fix-kernel-warning-when-removing-proc-entry.patch" Content-Disposition: attachment; filename="0001-nfs-fix-kernel-warning-when-removing-proc-entry.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hzugpdbn0 RnJvbSAyMWU4MTAwMmY5Nzg4YTNhZjU5MTQxNmI2ZGVjNjBkN2I2N2YyZmIyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBDb25nIFdhbmcgPHhpeW91Lndhbmdjb25nQGdtYWlsLmNvbT4K RGF0ZTogTW9uLCA4IFNlcCAyMDE0IDE2OjE3OjU1IC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gbmZz OiBmaXgga2VybmVsIHdhcm5pbmcgd2hlbiByZW1vdmluZyBwcm9jIGVudHJ5CgpJIHNhdyB0aGUg Zm9sbG93aW5nIGtlcm5lbCB3YXJuaW5nOgoKWyAxODUyLjMyMTIyMl0gLS0tLS0tLS0tLS0tWyBj dXQgaGVyZSBdLS0tLS0tLS0tLS0tClsgMTg1Mi4zMjY1MjddIFdBUk5JTkc6IENQVTogMCBQSUQ6 IDExOCBhdCBmcy9wcm9jL2dlbmVyaWMuYzo1MjEgcmVtb3ZlX3Byb2NfZW50cnkrMHgxNTQvMHgx NmIoKQpbIDE4NTIuMzM1NjMwXSByZW1vdmVfcHJvY19lbnRyeTogcmVtb3Zpbmcgbm9uLWVtcHR5 IGRpcmVjdG9yeSAnZnMvbmZzZnMnLCBsZWFraW5nIGF0IGxlYXN0ICd2b2x1bWVzJwpbIDE4NTIu MzQ0MDg0XSBDUFU6IDAgUElEOiAxMTggQ29tbToga3dvcmtlci91ODoyIE5vdCB0YWludGVkIDMu MTYuMCsgIzU0MApbIDE4NTIuMzUwMDM2XSBIYXJkd2FyZ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