Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932202Ab2BVE47 (ORCPT ); Tue, 21 Feb 2012 23:56:59 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:38795 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755681Ab2BVE46 (ORCPT ); Tue, 21 Feb 2012 23:56:58 -0500 MIME-Version: 1.0 In-Reply-To: References: <20120221.221609.218135609185671883.davem@davemloft.net> From: Linus Torvalds Date: Tue, 21 Feb 2012 20:56:36 -0800 X-Google-Sender-Auth: 7DKopasO-5vk2Zaly4wXEPRWT58 Message-ID: Subject: Re: compat: autofs v5 packet size ambiguity - update To: David Miller , Ian Kent Cc: linux-kernel@vger.kernel.org, "H. Peter Anvin" , autofs@vger.kernel.org, Thomas Meyer , Al Viro Content-Type: multipart/mixed; boundary=0016e6d625845a195204b9865baa Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8448 Lines: 132 --0016e6d625845a195204b9865baa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Feb 21, 2012 at 7:47 PM, Linus Torvalds wrote: > > And then it does a AUTOFS_IOC_PROTOVER ioctl to see what the protocol > version is. > > So we could just decide that > > =A0(a) we add a mount option for the packet size (or just "v6" - which > would be "v5 with a fixed packet size") > > =A0(b) in the absence of an explicit mount option, we look at > is_compat_task() for the first AUTOFS_IOC_PROTOVER ioctl we get. Ok, so here's a patch that does that. Well, it doesn't do that (a) part, but it does the auto-detection of whether the daemon is a compat process or not. THIS IS UNTESTED. Thomas - could you test this in your environment? I added your "Tested-by:", but that's really for the previous patch that tested is_compat_task() in the wrong context. Linus --0016e6d625845a195204b9865baa Content-Type: text/x-patch; charset=US-ASCII; name="0001-autofs-work-around-unhappy-compat-problem-on-x86-64.patch" Content-Disposition: attachment; filename="0001-autofs-work-around-unhappy-compat-problem-on-x86-64.pat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BAIC0xNTUsOCAr MTczLDcgQEAgc3RhdGljIHZvaWQgYXV0b2ZzNF9ub3RpZnlfZGFlbW9uKHN0cnVjdCBhdXRvZnNf c2JfaW5mbyAqc2JpLAogCXsKIAkJc3RydWN0IGF1dG9mc192NV9wYWNrZXQgKnBhY2tldCA9ICZw a3QudjVfcGt0LnY1X3BhY2tldDsKIAotCQlwa3RzeiA9IHNpemVvZigqcGFja2V0KTsKLQorCQlw a3RzeiA9IGF1dG9mc192NV9wYWNrZXRfc2l6ZShzYmkpOwogCQlwYWNrZXQtPndhaXRfcXVldWVf dG9rZW4gPSB3cS0+d2FpdF9xdWV1ZV90b2tlbjsKIAkJcGFja2V0LT5sZW4gPSB3cS0+bmFtZS5s ZW47CiAJCW1lbWNweShwYWNrZXQtPm5hbWUsIHdxLT5uYW1lLm5hbWUsIHdxLT5uYW1lLmxlbik7 Ci0tIAoxLjcuOS4xODguZzEyNzY2LmRpcnR5Cgo= --0016e6d625845a195204b9865baa-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/