From: "Janne Karhunen" Subject: [patch] fix statd -n Date: Thu, 17 Apr 2008 12:38:43 -0400 Message-ID: <24c1515f0804170938s23fe3ea3pfe77355ed01d8bbf@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1980_24658972.1208450324019" To: linux-nfs@vger.kernel.org Return-path: Received: from wr-out-0506.google.com ([64.233.184.227]:12160 "EHLO wr-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763098AbYDQQis (ORCPT ); Thu, 17 Apr 2008 12:38:48 -0400 Received: by wr-out-0506.google.com with SMTP id c48so127346wra.1 for ; Thu, 17 Apr 2008 09:38:45 -0700 (PDT) Sender: linux-nfs-owner@vger.kernel.org List-ID: ------=_Part_1980_24658972.1208450324019 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, Apparently lockd does not expect statd to be used with -n switch: statd is expected to bind loopback, always. Attached patches show one (IPv4 specific) way of fixing it. Comments? -- // Janne ------=_Part_1980_24658972.1208450324019 Content-Type: text/x-patch; name=statd-rmtcall.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_ff5jq2sq0 Content-Disposition: attachment; filename=statd-rmtcall.patch LS0tIHJtdGNhbGwuYy5vcmcJMjAwOC0wNC0xNCAxMDo1MzozMC4wMDAwMDAwMDAgLTA0MDAKKysr IHJtdGNhbGwuYwkyMDA4LTA0LTE0IDEzOjAxOjI3LjAwMDAwMDAwMCAtMDQwMApAQCAtMzcsNiAr MzcsNyBAQAogI2luY2x1ZGUgPG5ldGRiLmg+CiAjaW5jbHVkZSA8c3RyaW5nLmg+CiAjaW5jbHVk ZSA8dW5pc3RkLmg+CisjaW5jbHVkZSA8ZXJybm8uaD4KICNpZmRlZiBIQVZFX0lGQUREUlNfSAog I2luY2x1ZGUgPGlmYWRkcnMuaD4KICNlbmRpZiAvKiBIQVZFX0lGQUREUlNfSCAqLwpAQCAtNTQs NiArNTUsMzQgQEAKIAogc3RhdGljIHVuc2lnbmVkIGxvbmcJeGlkID0gMDsJLyogUlBDIFhJRCBj b3VudGVyICovCiBzdGF0aWMgaW50CQlzb2NrZmQgPSAtMTsJLyogbm90aWZ5IHNvY2tldCAqLwor c3RhdGljIGludCAgICAgICAgICAgICAgaWZzZXQgPSAwOworCisvKgorICogTm90aWZ5IGxvY2tk IG9mIG5vbi1zdGFuZGFyZCBiaW5kaW5nIAorICovCitpbmxpbmUgdm9pZAorbmxtX25zbV9zZXQo dW5zaWduZWQgaW50IGFkZHIpCit7CisgICAgICAgIHNzaXplX3Qgc3ogPSAwOworICAgICAgICBj aGFyIGJ1ZlsyMF07CisgICAgICAgIGludCBmZDsKKworICAgICAgICBpZiAoIGlmc2V0ICkKKyAg ICAgICAgICAgICAgICByZXR1cm4gOworCisgICAgICAgIHNwcmludGYgKGJ1ZiwiJXUiLGFkZHIp OworCisgICAgICAgIGZkID0gb3BlbiAoIi9wcm9jL3N5cy9mcy9uZnMvbmxtX25zbV9pbnRlcmZh Y2UiLCBPX1JEV1IpOworICAgICAgICBpZiAoZmQgPiAwKSB7CisgICAgICAgICAgICAgICAgc3og PSB3cml0ZSAoZmQsYnVmLHN0cmxlbigoY2hhciopYnVmKSk7CisgICAgICAgICAgICAgICAgaWYg KCBzeiA9PSAtMSApCisgICAgICAgICAgICAgICAgICAgICAgICBub3RlKE5fQ1JJVCwgInN0YXRk OiB3cml0ZTogJXNcbiIsIHN0cmVycm9yKGVycm5vKSk7CisgICAgICAgICAgICAgICAgY2xvc2Ug KGZkKTsKKyAgICAgICAgfSBlbHNlCisgICAgICAgICAgICAgICAgbm90ZShOX0NSSVQsICJzdGF0 ZDogLW4gd2FzIHNwZWNpZmllZCB3aXRoIHdpdGggbm8ga2VybmVsIHN1cHBvcnQ/XG4iKTsKKwor ICAgICAgICBpZnNldCA9IDE7Cit9CiAKIC8qCiAgKiBJbml0aWFsaXplIGNhbGxiYWNrIHNvY2tl dApAQCAtODUsNiArMTE0LDcgQEAgc3RhdGRfZ2V0X3NvY2tldChpbnQgcG9ydCkKIAkJc3RydWN0 IGhvc3RlbnQgKmhwID0gZ2V0aG9zdGJ5bmFtZShNWV9OQU1FKTsKIAkJaWYgKGhwKQogCQkJc2lu LnNpbl9hZGRyID0gKihzdHJ1Y3QgaW5fYWRkciAqKSBocC0+aF9hZGRyOworCQlubG1fbnNtX3Nl dCAoKHVuc2lnbmVkIGludClzaW4uc2luX2FkZHIuc19hZGRyKTsKIAl9CiAJaWYgKHBvcnQgIT0g MCkgewogCQlzaW4uc2luX3BvcnQgPSBodG9ucyhwb3J0KTsK ------=_Part_1980_24658972.1208450324019 Content-Type: text/x-patch; name=lockd-nsmif.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_ff5jqenl1 Content-Disposition: attachment; filename=lockd-nsmif.patch ZGlmZiAtTmF1cnAgbG9ja2Qub3JnL3N2YzRwcm9jLmMgbG9ja2Qvc3ZjNHByb2MuYwotLS0gbG9j a2Qub3JnL3N2YzRwcm9jLmMJMjAwOC0wNC0xNCAxMDo1ODoyOS4wMDAwMDAwMDAgLTA0MDAKKysr IGxvY2tkL3N2YzRwcm9jLmMJMjAwOC0wNC0xNCAxMjoxOTowNC4wMDAwMDAwMDAgLTA0MDAKQEAg LTIxLDYgKzIxLDggQEAKIAogI2RlZmluZSBOTE1EQkdfRkFDSUxJVFkJCU5MTURCR19DTElFTlQK IAorZXh0ZXJuIHVuc2lnbmVkIGludCBubG1fbnNtX2ludGVyZmFjZTsKKwogLyoKICAqIE9idGFp biBjbGllbnQgYW5kIGZpbGUgZnJvbSBhcmd1bWVudHMKICAqLwpAQCAtNDMwLDggKzQzMiw5IEBA IG5sbTRzdmNfcHJvY19zbV9ub3RpZnkoc3RydWN0IHN2Y19ycXN0ICoKIAltZW1jcHkoJnNhZGRy LCBzdmNfYWRkcl9pbihycXN0cCksIHNpemVvZihzYWRkcikpOwogCiAJZHByaW50aygibG9ja2Q6 IFNNX05PVElGWSAgICAgY2FsbGVkX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