Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3194692imw; Mon, 18 Jul 2022 03:58:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u5DSMkKMXQbChjHjCaVPknrmQw1Y6S4OP4nejzcbwUtNdmYOeLvlxRw4UHoH2WGS/28K86 X-Received: by 2002:a62:4e04:0:b0:52b:30f5:59b8 with SMTP id c4-20020a624e04000000b0052b30f559b8mr19203281pfb.37.1658141916538; Mon, 18 Jul 2022 03:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658141916; cv=none; d=google.com; s=arc-20160816; b=RTAGfxdFUICJ82ScvgZBlSx/IVgmwwQQF1hnXlGWlakf5SluK2vlICgt5VSt3whPBT xiN3r1bRhTorx5M0cxndUefoBgccp7zPnbiAWEvgmu7yrj1Mpgoqi/4mjSmTmDnmcplr fYMPOU3Bqv0ss9jEIUVvu411pS8+Q/bFycxcB1Xm7lAY9DcGOl4UEQFjR+ymzSh4pb7t sLDgDEbs0Gvy9s12ivaX8/s0r8huebx1Efb9sTqqfApdSLzBiUJi1qDOIBSyd/rdj8vK 020zRGjNTX/cL81IuTofs7j/S8svlF7nSfUgM/7EH1XoAhRRV5giapzW0HCbDXK2VDoJ lHEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=brw7Qg3lnuCU3/y55+KdWQLiIpHBhmRs0hmh8uLzt7Q=; b=ZsWh5i/lbb7f7dHJPkayiRFPFNugbzo9MoXaEqaVGx/AKsmHZnS7YckGWbqNq+exr1 K8O5YAo3WxEzkJiHvQ/4pKNvYCW3HOmy4ymbXhCSj9bl8sNQKKI3SEEWD/QiiNQEXTHS U7ohJSmrCyw3rhATWSg7Oh4Y7KhA+Tc3mHxes7yQ1SGZoTUZDgbDkZgi6an2CVwU+o20 uDyr13YUceVgQJTx7c8LM7S+5eDR7e7d3yXnW0yeYsjdnie6rT/LQEI6kr6fyBXwTGnS V0MIuaW1Vhd0Bs3zVHk8KbLlz2zO9KCT69I1s3wyLcxffnW2BEheV+dWOH6ajl7J54vX seCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kohlschutter-com.20210112.gappssmtp.com header.s=20210112 header.b=16A00L8W; 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 y23-20020a17090a105700b001f03d7fe672si14340201pjd.94.2022.07.18.03.58.21; Mon, 18 Jul 2022 03:58:36 -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=pass header.i=@kohlschutter-com.20210112.gappssmtp.com header.s=20210112 header.b=16A00L8W; 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 S234248AbiGRK4Y (ORCPT + 99 others); Mon, 18 Jul 2022 06:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234158AbiGRK4X (ORCPT ); Mon, 18 Jul 2022 06:56:23 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F44E1114A for ; Mon, 18 Jul 2022 03:56:22 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id v67-20020a1cac46000000b003a1888b9d36so9545695wme.0 for ; Mon, 18 Jul 2022 03:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kohlschutter-com.20210112.gappssmtp.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=brw7Qg3lnuCU3/y55+KdWQLiIpHBhmRs0hmh8uLzt7Q=; b=16A00L8W145N9zK8xgD+Jfp/q4pFJbTbS5qYx5lf8sy3cuM8JU+Q6I/0S+A415ZLOD CMGch0ehQr9j5mRrV+Mcv9j218cixAo+XCk6fzQevIpx9YkdgayuPwJh5TaFjN1TfGuW dwh55RlA2+oddLJJTs+SjGCaHhUQkZONHaSxUK5jcxJj242Whkjl+VxXFSR3S9iX5mHr CZVuVu70Aci+v4QRlnDcB4eiwqglkp3RIKh/YsgI7iTlT7Y0IXV8CMhwGiOZcP+iUsdR NYQD7GYn70rI9JZjHsMpGA/q21ddX9HQQXlkpV+ei5zhZEMud8RNi6XtEJD5UqAOR/Mw 86sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=brw7Qg3lnuCU3/y55+KdWQLiIpHBhmRs0hmh8uLzt7Q=; b=71gzUI7gv3SHUtg7+fuIiCW838MOvKr9ZXzsco9CVEGJEE1Tg08ctKZV+17lOvVi4G uUs9EaBxbe/bs1Y1sx2oeWPuZ0Typjy4mlJpjozMjE+9te6TPIrkUhZMbqEEl2jGCT8e hzNAKJfIyWXQMNgT1fKJH7nB8/UF8ztRRdtZwe+TEZ9Vl01W5RWtQYEIzA3O135EBefN 7Ljg1xSKFmYHhgY90GQE3DnU8GpfHsFJ2ujje11YnhjctHxB17l8OQsMab8AHQwLEBmG KahNMgLvaSmWTsSafi+Kqn3ByrcwTj5wMJZ7CHugvhGruJJKwgL7BQAvutupoI7Rs6GM 4xTg== X-Gm-Message-State: AJIora8NFn+TPMJCUAdTrEOY2EYS3vKrMNo28eVReH/ucZuSMpX5Dzvy /xd0KerAJBhBrSsnvbIIONAn5GJMHtzkrCAR X-Received: by 2002:a05:600c:2116:b0:3a3:7f:f3cc with SMTP id u22-20020a05600c211600b003a3007ff3ccmr7828689wml.28.1658141780507; Mon, 18 Jul 2022 03:56:20 -0700 (PDT) Received: from smtpclient.apple (ip5b434222.dynamic.kabel-deutschland.de. [91.67.66.34]) by smtp.gmail.com with ESMTPSA id d3-20020adfe883000000b0021d7ff34df7sm12566514wrm.117.2022.07.18.03.56.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2022 03:56:20 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: [PATCH] ovl: Handle ENOSYS when fileattr support is missing in lower/upper fs From: =?utf-8?Q?Christian_Kohlsch=C3=BCtter?= In-Reply-To: Date: Mon, 18 Jul 2022 12:56:19 +0200 Cc: overlayfs , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <4B9D76D5-C794-4A49-A76F-3D4C10385EE0@kohlschutter.com> <83A29F9C-1A91-4753-953A-0C98E8A9832C@kohlschutter.com> To: Miklos Szeredi X-Mailer: Apple Mail (2.3696.100.31) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 --=20 Dr. Christian Kohlsch=C3=BCtter > Am 18.07.2022 um 12:31 schrieb Miklos Szeredi : >=20 > On Mon, 18 Jul 2022 at 12:10, Christian Kohlsch=C3=BCtter > wrote: >>=20 >>> Am 18.07.2022 um 11:14 schrieb Miklos Szeredi : >>>=20 >>> On Mon, 4 Jul 2022 at 20:36, Christian Kohlsch=C3=BCtter >>> wrote: >>>>=20 >>>> 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. >>>=20 >>> 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. >>>=20 >>> 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. >>>=20 >>> The getxattr/setxattr implementations already translate ENOSYS to >>> EOPNOTSUPP, but ioctl doesn't. >>>=20 >>> The attached patch (untested) should do this. Can you please give = it a try? >>>=20 >>> Thanks, >>> Miklos >>> >>=20 >> Yes, that change basically has the same effect for the demo use = case,. >>=20 >> However: it will change (and potentially) break assumptions in user = space. We should never break user space. >>=20 >> 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 >=20 > No, it would return success. I'm referring to /test/lower (powered by fuse davfs2), not /test/mnt = (overlayfs). >=20 >> I also tried the setup (without patches) on a very old 4.4.176 = system, and everything works fine. ovl introduced the regression, so it = should also be fixed there. >> It may affect other filing systems as well (I see some other fs also = return ENOSYS on occasion). >>=20 >> It's safe to say that adding the ENOSYS to the ovl code is probably = the best move. Besides, you already have a workaround for ntfs-3g there = as well. >=20 > Flawed arguments. The change in overlayfs just made the preexisting > bug in fuse visible. The bug should still be fixed in fuse. I understand your point from ovl's perspective, however you are = proposing a fix in fuse, and so we have to see it from fuse's = perspective (and its users). =46rom ovl's point of view, your patch fixes it because the behavior in = ovl will now become how it was before the regression was introduced. However, users of fuse that have no business with overlayfs suddenly see = their ioctl return ENOTTY instead of ENOSYS.