Return-Path: linux-nfs-owner@vger.kernel.org Received: from smtp-out.cae.wisc.edu ([144.92.12.194]:48570 "EHLO smtp-out.cae.wisc.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754887AbaIRNHi (ORCPT ); Thu, 18 Sep 2014 09:07:38 -0400 Received: from smtp.cae.wisc.edu (smtp.cae.wisc.edu [144.92.12.51]) by smtp-out.cae.wisc.edu (8.14.3/8.14.3/Debian-9.4) with ESMTP id s8ID2XW6004118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 18 Sep 2014 08:02:33 -0500 Received: from [IPv6:2607:f388:1082:ffff:e967:18c3:7248:60ad] ([IPv6:2607:f388:1082:ffff:e967:18c3:7248:60ad]) (authenticated bits=0) by smtp.cae.wisc.edu (8.14.3/8.14.3/Debian-9.4) with ESMTP id s8ID2T0i009447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 18 Sep 2014 08:02:29 -0500 Message-ID: <541AD7E5.8020409@engr.wisc.edu> Date: Thu, 18 Sep 2014 08:02:29 -0500 From: James Drews Reply-To: drews@engr.wisc.edu MIME-Version: 1.0 To: linux-nfs@vger.kernel.org Subject: NFS Kernel Bug Content-Type: multipart/mixed; boundary="------------060402020204070106090003" Sender: linux-nfs-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------060402020204070106090003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Good morning! I believe we have found a bug in the NFS kernel area. The "bug" is a leak of a file handle where the NFS client never tells the server to close the file. The problem is very similar to one we had reported and got a fix for previously. We are using that patch, but ran in to another case where the client sends out an OPEN_DOWNGRADE but never sends a CLOSE. Attached is a simple c program that we have been able to reproduce the bug with, along with a packet capture of what we see on the wire. To reproduce the bug: -compile the c code -execute the c code with: ./test ; cat testfile3 > /dev/nul -now if we try to remove the file we get a file in use error (server is using mandatory locking) Things to note: -if you just run the program without the immediate cat'ing of the file, the bug does not happen suggesting a timing issue -If you alter the program so the code mimics the cat of the file, the bug does not happen (ie, add an open, read file, close to the code). -If you run the program as described above, and then run it again without the "; cat testfile3 > /dev/nul", the kernel squeaks out the file close to the server when the code does the close. The attached packet capture is us doing: ./test ; cat testfile3 > /dev/null rm testfile3 ./test rm testfile3 where we are denied the rm the first time, but not the second. Thanks James --------------060402020204070106090003 Content-Type: application/softgrid-c; name="test.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.c" I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzeXMvdHlwZXMuaD4KI2luY2x1ZGUgPHN5 cy9zdGF0Lmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KI2luY2x1ZGUgPGZjbnRsLmg+CiNpbmNs dWRlIDxzdGRsaWIuaD4KCiNkZWZpbmUgVEhFRklMRSAidGVzdGZpbGUzIgoKdm9pZCBtYWlu KHZvaWQpCnsKCWludCBmZD1vcGVuKFRIRUZJTEUsT19SRFdSfE9fQ1JFQVR8T19UUlVOQywg MDY2Nik7CgkKCXZvaWQgKmJ1Zj1tYWxsb2MoNTAwMDAwKTsKCWlmKGJ1ZikKCXsKCQlsc2Vl ayhmZCwgMTMxMDcyLCBTRUVLX1NFVCk7CgkJbHNlZWsoZmQsMjc2ODAsU0VFS19DVVIpOwoJ CXdyaXRlKGZkLCJUSElTIElTIFNPTUUgREFUQSIsMTgpOwoJCWZyZWUoYnVmKTsKCX0KCWVs c2UKCXsKCQlwcmludGYoIkkgY291bGRuJ3QgYWxsb2NhdGUgdGhlIGJ1ZmZlci5cbiIpOwoJ fQoJY2xvc2UoZmQpOwoJCn0K --------------060402020204070106090003 Content-Type: application/x-zip-compressed; name="nfsbug.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="nfsbug.zip" UEsDBBQAAAAIAPQ6MkWkOwvI3xYAAGjRAgALAHIATkZTQnVnLnBjYXBTRF0ApAAAAAAIANOe Z8xjZGBp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