From: Mark Hemment Subject: Re: lockd fails to purge blocked NLM_LOCKs Date: Wed, 6 Aug 2003 12:27:59 +0100 (BST) Sender: nfs-admin@lists.sourceforge.net Message-ID: References: <16173.61548.939819.343488@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-886247951-1060169279=:1062" Cc: Trond Myklebust , Return-path: Received: from bay-bridge.veritas.com ([143.127.3.10] helo=mtvmime03.VERITAS.COM) by sc8-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 19kMRu-0006wQ-00 for ; Wed, 06 Aug 2003 04:27:22 -0700 Received: from localhost.localdomain(markhe.wat.veritas.com[10.10.185.104]) (11671 bytes) by megami via sendmail with P:esmtp/R:smart_host/T:smtp (sender: ) id for ; Wed, 6 Aug 2003 04:27:15 -0700 (PDT) (Smail-3.2.0.101 1997-Dec-17 #15 built 2001-Aug-30) To: Neil Brown In-Reply-To: <16173.61548.939819.343488@gargle.gargle.HOWL> Errors-To: nfs-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Id: Discussion of NFS under Linux development, interoperability, and testing. List-Unsubscribe: , List-Archive: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --8323328-886247951-1060169279=:1062 Content-Type: text/plain; charset="us-ascii" On Mon, 4 Aug 2003, Neil Brown wrote: > On Friday August 1, markhe@veritas.com wrote: > > When stopping server-side NFS, or deleting a client (NFSCTL_DELCLIENT), > > lockd fails to purge blocked lockd requests. > > Thanks Mark. I'm at least largely convinced. > > My only question concerns nlmsvc_traverse_blocks. > This uses b_host and you have (subtley) changed the meaning of b_host. That is the idea. In host.c, the nlm_hosts[] 'database' contains two types of entries; a) those created with an "svc_client" (h_exportent != NULL) b) those created without an "svc_client" (h_exportent = NULL) Type a) entries refer back to nfsd's client 'database'. Type b) entries are independent of nfsd. nlmsvc_traverse_blocks() is expecting ->b_host to refer to an entry in "nlm_hosts[]" which refers back to a type a) entry. Without the patch, ->b_host refers to a type b) entry. I've attached my write-up from our internal bug tracking system; it has a bit more detailed. Also, I've attached a simple program for demonstrating the problem (foo-lock). The steps are; i) Create a scratch filesystem on the Linux NFS server and mount it, say at point /mnt/fs1, and export it. Created a small test file; # cp /etc/hosts /mnt/fs1/testfile ii) Mount the exported filesystem on a client, sat at point /mnt/scratch iii) Login to a client twice. On the first login, run the test program; # ./foo-lock /mnt/scratch/testfile Attempting to get lock... Got lock..sleeping for 60 seconds On the second login, run the test program before the first expires - it will block for the lock; # ./foo-lock /mnt/scratch/testfile Attempting to get lock... iv) Stop NFS on the server before the first test program expires. For RedHat; # /etc/init.d/nfs stop v) Now try to umount the fileystem on the server; # umount /mnt/fs1 Busy? Even stopping lockd will not help. The server needs to be rebooted. Thanks, Mark --8323328-886247951-1060169279=:1062 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="foo-lock.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: foo-lock.c Content-Disposition: attachment; filename="foo-lock.c" I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8dW5pc3RkLmg+DQojaW5j bHVkZSA8c3lzL3R5cGVzLmg+DQojaW5jbHVkZSA8c3lzL3N0YXQuaD4NCiNp bmNsdWRlIDxmY250bC5oPg0KDQojZGVmaW5lCVNMRUVQVElNRQk2MA0KI2Rl ZmluZSBTdHIoeCkJCSN4DQojZGVmaW5lIFhzdHIoeCkJCVN0cih4KQ0KDQp2 b2lkDQp1c2FnZSh2b2lkKQ0Kew0KCWZwcmludGYoc3RkZXJyLCAiVXNhZ2U6 IGZvby1sb2NrIHBhdGhuYW1lXG4iKTsNCglleGl0KDIpOw0KfQ0KDQppbnQN Cm1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQ0Kew0KCXN0cnVjdCBmbG9j awlmbG9jazsNCglpbnQJCWZkOw0KDQoJaWYgKGFyZ2MgIT0gMikgew0KCQl1 c2FnZSgpOw0KCQkvKiBOT1RSRUFDSEVEICovDQoJfQ0KDQoJZmQgPSBvcGVu KGFyZ3ZbMV0sIE9fUkRXUik7DQoJaWYgKGZkID09IC0xKSB7DQoJCXBlcnJv cigib3BlbiIpOw0KCQlleGl0KDEpOw0KCX0NCg0KCWZsb2NrLmxfdHlwZSA9 IEZfV1JMQ0s7DQoJZmxvY2subF93aGVuY2UgPSBTRUVLX1NFVDsNCglmbG9j ay5sX3N0YXJ0ID0gMDsNCglmbG9jay5sX2xlbiA9IChvZmZfdCkxMDsNCg0K CXByaW50ZigiQXR0ZW1wdGluZyB0byBnZXQgbG9jay4uLlxuIik7DQoJaWYg KGZjbnRsKGZkLCBGX1NFVExLVywgJmZsb2NrKSA9PSAtMSkgew0KCQlwZXJy b3IoImZjbnRsIik7DQoJCWV4aXQoMSk7DQoJfQ0KDQoJcHJpbnRmKCJHb3Qg bG9jay4uc2xlZXBpbmcgZm9yICIgWHN0cihTTEVFUFRJTUUpICIgc2Vjb25k c1xuIik7DQoJc2xlZXAoU0xFRVBUSU1FKTsNCg0KCXByaW50ZigiQ2xvc2lu ZyBmaWxlXG4iKTsNCgkodm9pZCljbG9zZShmZCk7DQoJZXhpdCgwKTsNCn0N Cg== --8323328-886247951-1060169279=:1062 Content-Type: TEXT/plain; name="incident-127591.txt" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: incident-127591.txt Content-Disposition: attachment; filename="incident-127591.txt" ICBXaGVuIHRoZSBzZXJ2ZXIgY2Fubm90IGltbWVkaWF0ZWx5IGdyYW50IGEg bG9jayByZXF1ZXN0IChOTE1fTE9DSyksDQppdCBjcmVhdGVzIGFuICJzdHJ1 Y3QgbmxtX3dhaXQiIChha2EgImJsb2NrIikgaW4NCnN2Y2xvY2suYzpubG1z dmNfY3JlYXRlX2Jsb2NrKCk7DQogICAgICAgIC8qIENyZWF0ZSBob3N0IGhh bmRsZSBmb3IgY2FsbGJhY2sgKi8NCiAgICAgICAgaG9zdCA9IG5sbWNsbnRf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ogICAgICAgIFJQQyBjYWxsLCBidXQgaWYgaXQgaXMgdGhlbiB0 aGUgY3VycmVudCBjb2RlIHdpbGwgaGF2ZSBwcm9ibGVtcy4uLg0KDQogIEFz IHRoZSBvbmx5IHJlbWFpbmluZyB1c2Ugb2YgIi0+Yl9ob3N0IiBpcyB0byB0 ZWFyZG93biAibmxtX2Jsb2NrInMNCmR1cmluZyBhbiB1bmV4cG9ydCwgdGhl biBzZXR0aW5nIGl0IHRvIHRoZSAncGVyLWV4cG9ydCcgY2xpZW50IGVudHJ5 DQppbiBubG1zdmNfY3JlYXRlX2Jsb2NrKCkgc2hvdWxkIHNvbHZlIGFsbCB0 aGUgcHJvYmxlbXM7DQogICAgICAgIGJsb2NrLT5iX2hvc3QgPSBubG1zdmNf bG9va3VwX2hvc3QocnFzdHApOw0KICAgICAgICBpZiAoYmxvY2stPmJfaG9z dCA9PSBOVUxMKSB7DQogICAgICAgICAgICAgICAgbmxtY2xudF9mcmVlZ3Jh bnRhcmdzKCZibG9jay0+Yl9jYWxsKTsNCiAgICAgICAgICAgICAgICBnb3Rv IGZhaWxlZF9mcmVlOw0KICAgICAgICB9DQooYWN0dWFsbHksIGJlc3QgdG8g bW92ZSBzZXR0aW5nIG9mIGJfaG9zdCB0byBiZWZvcmUgbmxtY2xudF9zZXRn cmFudGFyZ3MoKSwNCnJlbW92aW5nIHRoZSBuZWVkIGZvciBubG1jbG50X2Zy ZWVncmFudGFyZ3MoKSkNCg== --8323328-886247951-1060169279=:1062-- ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs