Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3181460imw; Mon, 18 Jul 2022 03:40:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tJvlDE5nq8tJI1sk/Nh9aQeLivSXKcg6ZCx+iYY6KctNmkFEaIONYZosm8Fv3rDkMeWg12 X-Received: by 2002:a17:902:8a91:b0:16c:c8e2:9398 with SMTP id p17-20020a1709028a9100b0016cc8e29398mr16582510plo.111.1658140857460; Mon, 18 Jul 2022 03:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658140857; cv=none; d=google.com; s=arc-20160816; b=iu6eciiXAWN/701Pio8ZPBFJtpjL3k2/TleqplGN66T/4aOg8+MvgU8/bpphyAV9di tYxIuO3Kc7RZCtn+rzDMl1Xvlg7HJoIBXiDvYujQlAGiOMMnA1wm8wroCESEF9VJyrXw s6UWnSrKpml3de35ZanxoisprAmB0WxFbjeEVP2PepmMa3dRjuXiPQNgq+dEKNha27dk S3cJgTQ7Di2sqcUITN5jtIallLBnxq62BTlEKOG9CxDSXQsCWDZcaa5YfUZ8z8lnU8Ac Zu+bNH8U2uhBVlOnkW4JEb3e28GxQRfkFDpYxqN5BCDthVrj/0O0ZvQernMWWSNfrhn1 916Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MqsgmudFUTM/vtDuIe2QaQKJlIBj/+EUqYo8B8GUpLw=; b=oWGfsR2cVIjQUTDr2xB/7Q7WxDaIx5bxlBoVh/XJL+Knb0mMnsMeMJ916OnW+TgNJF 4O/R1fpPSdM9TGxM8YzXS1PWajr+SMvXbAUibCQlUFCG9cd9xNBqAKWM4tyjfJd3L95u 4SnpShGv9vNhqve18Ev1eJ7bHNPUyhzoGL+ovxvIOWl9hP2Knu841ZEf8X6/nst4v2hR XEuHoV0aglikqNfRmgZo1XIvn21cKZII7YFLVsq6nXZIabtN7lk0xLlyzpGYzO/hk1BU li8jC+KPTLX+46iM9+MocDDrVZVCiSibXpZ9D9hgrkxR52ECNfLRXCbWODGKWIQqBd6m P1ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=QjRNRxJk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk12-20020a17090b33cc00b001f027dd6560si18433923pjb.61.2022.07.18.03.40.41; Mon, 18 Jul 2022 03:40:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=QjRNRxJk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234257AbiGRKbu (ORCPT + 99 others); Mon, 18 Jul 2022 06:31:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234230AbiGRKbs (ORCPT ); Mon, 18 Jul 2022 06:31:48 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FB8B1D0E1 for ; Mon, 18 Jul 2022 03:31:47 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id y8so14637064eda.3 for ; Mon, 18 Jul 2022 03:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MqsgmudFUTM/vtDuIe2QaQKJlIBj/+EUqYo8B8GUpLw=; b=QjRNRxJkpgPUfiDF9V/yyF6+te/ukyNFnvFSR+xeuCxO4yOT1FQfRtv0NcBf1as61E bGSgBEfaK70yFJqBKOliJikOkFexQli2wJadkju7HJhYjKMD+dr4/ymvPPPzVxk4ub7u eyt0hTe6vOGmsyibgHDqXX/K16RNKqIXVW3ZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MqsgmudFUTM/vtDuIe2QaQKJlIBj/+EUqYo8B8GUpLw=; b=SQeWwoJHKd/wXrfEa9wQ72CAP/lJJY8UnKPFbw025VhNE0zaHyrSP6Z6zKqsXup7GI I+hZOnL+S4BB/WE22LvaT8b5/GtPrZG20vTHHal2ZEE1B2RJmtP9/D0XDXrWGUdt2+5z UC9Bqsg30r7P5zT8UPSt5EImKAk9/b0yhIKyyw16luw4ltJeIF9Qu669O/cDt0SWQ1e4 r7qQAAFKOOiAZJExmHT4CdqBA/2LuOf9crpEk5hGJaSynEvVLIKKjLoCQawpqGseVmNM CSgn3jR/fCyqMHjRqZq6rkzRhUi+Ki4dfXbRZOb2nHP0Mbqzzw/fjJOe6m/SrfPqDrii EvJg== X-Gm-Message-State: AJIora/GoCqhxt/jBLSgO6hOkN7+45NYBuVtFB90XnAtKpOCi0vQDIJX HJlq/OYlT30AT1bxfqB9e31XigTtFoREwF+pkGY46w== X-Received: by 2002:a05:6402:5205:b0:43a:b520:c7de with SMTP id s5-20020a056402520500b0043ab520c7demr36393790edd.22.1658140306156; Mon, 18 Jul 2022 03:31:46 -0700 (PDT) MIME-Version: 1.0 References: <4B9D76D5-C794-4A49-A76F-3D4C10385EE0@kohlschutter.com> <83A29F9C-1A91-4753-953A-0C98E8A9832C@kohlschutter.com> In-Reply-To: <83A29F9C-1A91-4753-953A-0C98E8A9832C@kohlschutter.com> From: Miklos Szeredi Date: Mon, 18 Jul 2022 12:31:35 +0200 Message-ID: Subject: Re: [PATCH] ovl: Handle ENOSYS when fileattr support is missing in lower/upper fs To: =?UTF-8?Q?Christian_Kohlsch=C3=BCtter?= Cc: overlayfs , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jul 2022 at 12:10, Christian Kohlsch=C3=BCtter wrote: > > > Am 18.07.2022 um 11:14 schrieb Miklos Szeredi : > > > > On Mon, 4 Jul 2022 at 20:36, Christian Kohlsch=C3=BCtter > > wrote: > >> > >> overlayfs may fail to complete updates when a filesystem lacks > >> fileattr/xattr syscall support and responds with an ENOSYS error code, > >> resulting in an unexpected "Function not implemented" error. > > > > Issue seems to be with fuse: nothing should be returning ENOSYS to > > userspace except the syscall lookup code itself. ENOSYS means that > > the syscall does not exist. > > > > Fuse uses ENOSYS in the protocol to indicate that the filesystem does > > not support that operation, but that's not the value that the > > filesystem should be returning to userspace. > > > > The getxattr/setxattr implementations already translate ENOSYS to > > EOPNOTSUPP, but ioctl doesn't. > > > > The attached patch (untested) should do this. Can you please give it = a try? > > > > Thanks, > > Miklos > > > > Yes, that change basically has the same effect for the demo use case,. > > However: it will change (and potentially) break assumptions in user space= . We should never break user space. > > Example: lsattr /test/lower > Currently, fuse returns ENOSYS, e.g. > > lsattr: reading ./lost+found: Function not implemented > With your change, it would return ENOTTY > > lsattr: reading ./lost+found: Not a tty No, it would return success. > I also tried the setup (without patches) on a very old 4.4.176 system, an= d everything works fine. ovl introduced the regression, so it should also b= e fixed there. > It may affect other filing systems as well (I see some other fs also retu= rn ENOSYS on occasion). > > It's safe to say that adding the ENOSYS to the ovl code is probably the b= est move. Besides, you already have a workaround for ntfs-3g there as well. Flawed arguments. The change in overlayfs just made the preexisting bug in fuse visible. The bug should still be fixed in fuse. Thanks, Miklos