Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1517321rda; Mon, 23 Oct 2023 15:25:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjpZJdQooGuo/YnPhvIHjRxmJsk6Vejt1Jzo/70lRwjUaaOFW6X9HOEV0jZY4eDi2IN/e/ X-Received: by 2002:a17:90b:4c52:b0:27d:4278:ba53 with SMTP id np18-20020a17090b4c5200b0027d4278ba53mr8634760pjb.47.1698099950238; Mon, 23 Oct 2023 15:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698099950; cv=none; d=google.com; s=arc-20160816; b=Md5Y0K9lshfm4ykvrcIMH5kJuYksSvCiPJ4ZlRedL3XCiUVKzzmt142B6AiZh+MMCf C1hMlz4Lv/09S8UcjTi0l0V7SaqjI9UVRML23EVpxnK4Whi4HMe1kpi9YyU7WqL+XaeP U7rbKmg7+JJgYjAuPbJ4LQnmYKtdHu6E7bXSfrOmXz+FnaQz3sL0YBlhacN8GLN+3E1o 9l+tHugc7ocV59krwEfmKJ9IlLSGaerAH7LoIroFebQQThoCo9mo/g9GeO+PC0gFI1Sx MbgKq8d8IoabKvhNBlWRMu2m74NO2U66maAN6xI7nbE9l2ENNkJoXNozQ4W3MxNABKnC fnIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=DQ1oEKixkzeNQdS8WT8YM8d2fPyTvXJ7mH7o5ICCQX8=; fh=P/JCioSsL/UZTRqA59j08uwECN4RIehYM4RGJg1jCcY=; b=aDCbnwKcDYn6oLEsvDMVsPeKyIDYpLsThwrgBh87URVjKQMLVtfbBXOwmAKF24GCt0 nsibiSMFZD9Clje7ajXrttwesaQ9gzEdJgFvVgG6g95jiLsSb3whrR+NJP54Na4D0dBJ s3tMgnEItPgkA0I3GLi3T1qn3QyIv79zx20p8Gyy1aGaje+xvgZlrpSqp3ZUMJKkcCki TbnbjfSZsp3tZlJ/tvdG/lEZIo+90xhHQb7es6h3iFqDiauVeum0uly3EgKfLwv3cKAP HjZb+yikEnprRfivcYt3zY1P8GawgvZo8nek0FozLiCEAnuQ6LF8AsbXGE+s+RaHPPBt xH9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b="WQYsw/i9"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ngQdFqQ6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id oo11-20020a17090b1c8b00b00273f1cd73b2si7561152pjb.75.2023.10.23.15.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 15:25:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b="WQYsw/i9"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ngQdFqQ6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8F3008072A3E; Mon, 23 Oct 2023 15:25:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229657AbjJWWYd (ORCPT + 99 others); Mon, 23 Oct 2023 18:24:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjJWWYc (ORCPT ); Mon, 23 Oct 2023 18:24:32 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63627BC; Mon, 23 Oct 2023 15:24:30 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0E2035C038B; Mon, 23 Oct 2023 18:24:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 23 Oct 2023 18:24:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1698099868; x=1698186268; bh=DQ1oEKixkzeNQdS8WT8YM8d2fPyTvXJ7mH7 o5ICCQX8=; b=WQYsw/i93/NXdnTcDjqLcXE/CwRWdo6Erxs82JyFuS3qBV27yb5 evLbD6PRVhjROmAXc5wPwVttUQOVMlDpr8S4oyvC/jlclLt/5UYz1rDNG3EpfrJw sBC1Eu1kIJvIpmxwtCGd+K1CwyzKz5098UPtxpCgtdhD4TvjozoregDwnhDo5KbV FBsD7V6Q4IAvu4jZc0B/nIBni0DjIIw6siCW3yPDRDlhs3fGS4u6lpTH5kLi5QHC Oa36iyfDrYlCLUKiV5nOtC238vM5CHD8Wqo9vsXRM7AwhGru2CcOqdsZvkIX0XSa /Ow32rdaOmylMU5dwUsj+ZDLM9qHx5ghwbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698099868; x=1698186268; bh=DQ1oEKixkzeNQdS8WT8YM8d2fPyTvXJ7mH7 o5ICCQX8=; b=ngQdFqQ601DzjSAFMnRWltajrABxEepDBmnnnhz5x30qUxKa6mv NS4hbZ5ZvdicPtj8Jp1n/UuEbAno2QnlZgEyN/UoJdPUlNloZ9Ce3DUOzrQv/4ge bt700eHhsWIfYVBfLdBIG9OwapIX8rEWJ826peIdwQv6V8cYEA6YzLgxmbE88jcE aDmq9xbaz/96mf5YxhzQSO5CtZc78v+n+DDIaNMI77JkYF+QCs4JSI/IJEdl0qz8 42wSbBDUrGsPolA2mBe+f11xtWJ7dsOffM4liUR+Q11Vwrp1nop3z9JBVHhzIcwg c9sMlY/wgpxzdDJnyPpQr+1kTfIMm5GUMSg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeejgddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepkfgrnhcu mfgvnhhtuceorhgrvhgvnhesthhhvghmrgifrdhnvghtqeenucggtffrrghtthgvrhhnpe euhfeuieeijeeuveekgfeitdethefguddtleffhfelfeelhfduuedvfefhgefhheenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrrghvvghnse hthhgvmhgrfidrnhgvth X-ME-Proxy: Feedback-ID: i31e841b0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Oct 2023 18:24:22 -0400 (EDT) Message-ID: Date: Tue, 24 Oct 2023 06:24:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: autofs: add autofs_parse_fd() To: Anders Roxell Cc: Arnd Bergmann , Dan Carpenter , Naresh Kamboju , open list , lkft-triage@lists.linaro.org, linux-fsdevel@vger.kernel.org, autofs@vger.kernel.org, Bill O'Donnell , Christian Brauner References: <71adfca4-4e80-4a93-b480-3031e26db409@app.fastmail.com> <432f1c1c-2f77-4b1b-b3f8-28330fd6bac3@kadam.mountain> <11ba98f2-2e59-d64b-1a1a-fd32fd8ba358@themaw.net> <9217caeb-0d7e-b101-33f0-859da175a6ef@themaw.net> Content-Language: en-US From: Ian Kent In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 15:25:35 -0700 (PDT) On 23/10/23 21:57, Anders Roxell wrote: > On Mon, 23 Oct 2023 at 09:35, Ian Kent wrote: >> On 23/10/23 08:48, Ian Kent wrote: >>> On 20/10/23 21:09, Ian Kent wrote: >>>> On 20/10/23 19:23, Arnd Bergmann wrote: >>>>> On Fri, Oct 20, 2023, at 12:45, Dan Carpenter wrote: >>>>>> On Fri, Oct 20, 2023 at 11:55:57AM +0200, Anders Roxell wrote: >>>>>>> On Fri, 20 Oct 2023 at 08:37, Arnd Bergmann wrote: >>>>>>>> On Thu, Oct 19, 2023, at 17:27, Naresh Kamboju wrote: >>>>>>>>> The qemu-x86_64 and x86_64 booting with 64bit kernel and 32bit >>>>>>>>> rootfs we call >>>>>>>>> it as compat mode boot testing. Recently it started to failed to >>>>>>>>> get login >>>>>>>>> prompt. >>>>>>>>> >>>>>>>>> We have not seen any kernel crash logs. >>>>>>>>> >>>>>>>>> Anders, bisection is pointing to first bad commit, >>>>>>>>> 546694b8f658 autofs: add autofs_parse_fd() >>>>>>>>> >>>>>>>>> Reported-by: Linux Kernel Functional Testing >>>>>>>>> Reported-by: Anders Roxell >>>>>>>> I tried to find something in that commit that would be different >>>>>>>> in compat mode, but don't see anything at all -- this appears >>>>>>>> to be just a simple refactoring of the code, unlike the commits >>>>>>>> that immediately follow it and that do change the mount >>>>>>>> interface. >>>>>>>> >>>>>>>> Unfortunately this makes it impossible to just revert the commit >>>>>>>> on top of linux-next. Can you double-check your bisection by >>>>>>>> testing 546694b8f658 and the commit before it again? >>>>>>> I tried these two patches again: >>>>>>> 546694b8f658 ("autofs: add autofs_parse_fd()") - doesn't boot >>>>>>> bc69fdde0ae1 ("autofs: refactor autofs_prepare_pipe()") - boots >>>>>>> >>>>>> One difference that I notice between those two patches is that we no >>>>>> long call autofs_prepare_pipe(). We just call autofs_check_pipe(). >>>>> Indeed, so some of the f_flags end up being different. I assumed >>>>> this was done intentionally, but it might be worth checking if >>>>> the patch below makes any difference when the flags get put >>>>> back the way they were. This is probably not the correct fix, but >>>>> may help figure out what is going on. It should apply to anything >>>>> from 546694b8f658 ("autofs: add autofs_parse_fd()") to the current >>>>> linux-next: >>>>> >>>>> --- a/fs/autofs/inode.c >>>>> +++ b/fs/autofs/inode.c >>>>> @@ -358,6 +358,11 @@ static int autofs_fill_super(struct super_block >>>>> *s, struct fs_context *fc) >>>>> pr_debug("pipe fd = %d, pgrp = %u\n", >>>>> sbi->pipefd, pid_nr(sbi->oz_pgrp)); >>>>> + /* We want a packet pipe */ >>>>> + sbi->pipe->f_flags |= O_DIRECT; >>>>> + /* We don't expect -EAGAIN */ >>>>> + sbi->pipe->f_flags &= ~O_NONBLOCK; >>>>> + >>>> >>>> That makes sense, we do want a packet pipe and that does also mean >>>> >>>> we don't want a non-blocking pipe, it will be interesting to see >>>> >>>> if that makes a difference. It's been a long time since Linus >>>> >>>> implemented that packet pipe and I can't remember now what the >>>> >>>> case was that lead to it. >>> After thinking about this over the weekend I'm pretty sure my mistake >>> >>> is dropping the call to autofs_prepare_pipe() without adding the tail >>> >>> end of it into autofs_parse_fd(). >>> >>> >>> To explain a bit of history which I'll include in the fix description. >>> >>> During autofs v5 development I decided to stay with the existing usage >>> >>> instead of changing to a packed structure for autofs <=> user space >>> >>> communications which turned out to be a mistake on my part. >>> >>> >>> Problems arose and they were fixed by allowing for the 64 bit to 32 bit >>> >>> size difference in the automount(8) code. >>> >>> >>> Along the way systemd started to use autofs and eventually encountered >>> >>> this problem too. systemd refused to compensate for the length difference >>> >>> insisting it be fixed in the kernel. Fortunately Linus implemented the >>> >>> packetized pipe which resolved the problem in a straight forward and >>> >>> simple way. >>> >>> >>> So I pretty sure that the cause of the problem is the inadvertent >>> dropping >>> >>> of the flags setting in autofs_fill_super() that Arnd spotted although I >>> >>> don't think putting it in autofs_fill_super() is the right thing to do. >>> >>> >>> I'll produce a patch today which includes most of this explanation for >>> >>> future travelers ... >> So I have a patch. >> >> >> I'm of two minds whether to try and use the instructions to reproduce this >> >> or not because of experiences I have had with other similar testing >> automation >> >> systems that claim to provide a reproducer and end up a huge waste of >> time and >> >> are significantly frustrating. >> >> >> Can someone please perform a test for me once I provide the patch? > Just tested it, and it passed our tests. Added a tested by flag in your patch. > > Thanks for the prompt fix. That's great to hear Anders, thanks for doing the testing, ;) Ian