Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3645101imw; Mon, 18 Jul 2022 11:51:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uZHmNxhdGiMZo1phylVAL/bjvR9K1O/PfVZaKO+wf2SOx0eQZDFP+EXyRIRSOh+plrPCSv X-Received: by 2002:a17:902:c146:b0:16b:db72:a9bb with SMTP id 6-20020a170902c14600b0016bdb72a9bbmr28921169plj.51.1658170296255; Mon, 18 Jul 2022 11:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658170296; cv=none; d=google.com; s=arc-20160816; b=JKq95K92PnKvMYAD0H3vdz4mrchA5OBJ8sO4BwPhmm15VfIv42jVr7Hqyejtvd7Lhk 6z2dVL6rigFwk4TwIehi8olz2n2kTusojDqEEZDOTklvb+X76qMFfpKiK6huw0sKvWbW s55GrO6IsoYadTCaXRpSMKTQzaFry7cVrZQc9YBXSZTHxpCesQtQfqdb+4qCMRNZGsV2 oC2x/Z+5TvS/DaI6LcJGQCEJeTZzLbMWgfjea7MRAt9OxXS9Rh9U6lXwAqosCPKQUpMm QfjgdBgfwBsh/nix9WYw+vJnImZWXI4CWhlJry8egEfonPOerkFTd/FPAHPoT9nRBca3 EahQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Cmv5hgCvNzLGGr3LktdlyBF/B6b4xDynWT6Leb6vwMU=; b=V4ygtdgXOadijDDC2esJ+P2jqFbt4wIHM5MC4sfgpXpig8wR+8FcnN8jQrHlAgIgCx z27TF6fBnJUIAvsPygiNnf3YeOBqvR4VEyhq+FAfIkpXasIvdYKFIc4gY8fdM7NN4F7B 5fgHvQq3LM5guJlv+CftrYlR/fa5xH1ai0i+ylIMmUKQGSWSNMa7eQNXtM3/1y8mI++2 s7mmOeRHI3O5fZpxRnAGrguNYtFN/KET55GF5emTCjzFPtVSU3cXJ6l8bszCZ923QTqZ 01FLx/7NAXLAQ0/3x1gxhs40Bb6HgWpOBN03wsEAU90b8hvMhxgsa9mxl6srvXNlb9xF 7j5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KBwiHB+S; 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 y193-20020a638aca000000b0040d54868742si14619664pgd.24.2022.07.18.11.51.20; Mon, 18 Jul 2022 11:51: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=@linux-foundation.org header.s=google header.b=KBwiHB+S; 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 S235997AbiGRSaG (ORCPT + 99 others); Mon, 18 Jul 2022 14:30:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235992AbiGRSaE (ORCPT ); Mon, 18 Jul 2022 14:30:04 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D6B51EC50 for ; Mon, 18 Jul 2022 11:30:03 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id os14so22897372ejb.4 for ; Mon, 18 Jul 2022 11:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Cmv5hgCvNzLGGr3LktdlyBF/B6b4xDynWT6Leb6vwMU=; b=KBwiHB+SXKRnkpvfkXzleS7byHrzZEABKfttt7pWmaEsExqk03fAWoqPR7nKPf3yLn Fyy7ZwVpbxtKJXXXE5vUlGB1XmrO7dWEjESKiVizPyTEuMwzHXNx/5JkAO4H6cQPZBsZ raIzGwzOE6ZLTmMNCIsGijKHIUXqYKCek8XUw= 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; bh=Cmv5hgCvNzLGGr3LktdlyBF/B6b4xDynWT6Leb6vwMU=; b=3lVydobOiTEoazTgdN75b8bX4tDeheZB3F1uXc8kRxpEvxixqStMmdHp7BvSwxbZP4 WK/bcYA15FJtbJDUtKccZcfgSsuv+GCebEixmyik9Sx4Ecrf33SLBFq0c0xv8d+6KHVN 9S2RhS3is9EZOu3q5I2v7Ca0+3a1wAIpw9c37CXuJ3ERRxyVjzhGl1/WirbYxwIy0yMa YK//g4eR2qyeNAkQvcXBNcqhpJr3BQ6wPX+qV+ZapuRBD4+amRp/cODhQWVx4g7Avn+s rNnWUymp36KFV7hxlXH9k6T3G8Y3qvUcP3/X/fhSnY7z7oRDxiPDdOLrPKpOrvnWKtux 4oow== X-Gm-Message-State: AJIora/E3X+6hO8mmf2QgXmCSpQvndmj+PhhuOgTupCQT3FGmuRyvuW3 LzosRxEbHeMLn9h1epIec1pJxqW8iepzlyAH X-Received: by 2002:a17:907:97cd:b0:72f:2df:274f with SMTP id js13-20020a17090797cd00b0072f02df274fmr15000195ejc.766.1658169001430; Mon, 18 Jul 2022 11:30:01 -0700 (PDT) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com. [209.85.221.47]) by smtp.gmail.com with ESMTPSA id d15-20020a170906304f00b0072f42ca2932sm810410ejd.137.2022.07.18.11.30.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Jul 2022 11:30:00 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id r2so17294182wrs.3 for ; Mon, 18 Jul 2022 11:30:00 -0700 (PDT) X-Received: by 2002:a5d:69c2:0:b0:21d:807c:a892 with SMTP id s2-20020a5d69c2000000b0021d807ca892mr23808743wrw.274.1658168999877; Mon, 18 Jul 2022 11:29:59 -0700 (PDT) MIME-Version: 1.0 References: <4B9D76D5-C794-4A49-A76F-3D4C10385EE0@kohlschutter.com> <83A29F9C-1A91-4753-953A-0C98E8A9832C@kohlschutter.com> In-Reply-To: From: Linus Torvalds Date: Mon, 18 Jul 2022 11:29:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] [REGRESSION] ovl: Handle ENOSYS when fileattr support is missing in lower/upper fs To: Miklos Szeredi Cc: =?UTF-8?Q?Christian_Kohlsch=C3=BCtter?= , overlayfs , linux-kernel , linux-fsdevel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 On Mon, Jul 18, 2022 at 6:13 AM Miklos Szeredi wrote: > > Correct. The question is whether any application would break in this > case. I think not, but you are free to prove otherwise. Most often, an error is "just an error", and most applications usually won't care. There are exceptions: some errors are very much "do something special" (eg EAGAIN or EINTR _are_ often separately tested for and often mean "just retry"). And permission error handling is often different from EINVAL etc. And ENOSYS can easily be such an error - people probing whether they are running on a new kernel that supports a new system call or not. And yeah, some of our ioctl's are odd, and we have a lot of drivers (and driver infrastructure) that basically does "this device does not support this ioctl, so return ENOSYS". I don't think that's the right thing to do, but I think it's understandable. The traditional error for "this device does not support this ioctl" is ENOTTY, which sounds so crazy to non-tty people that I understand why people have used ENOSYS instead. It's sad that it's called "ENOTTY" and some (at least historical) strerror() implementations will indeed return "Not a tty". Never mind that modern ones will say "inappropriate ioctl for device" - even when the string has been updated, the error number isn't called EINAPPROPRAITEDEVICE. But it is what it is, and so I think ENOTTY is understandably not used in many situations just because it's such a senseless historical name. And so if people don't use ENOSYS, they use EINVAL. I *suspect* no application cares: partly because ioctl error numbers are so random anyway, but also very much if this is a "without overlayfs it does X, with overlayfs it does Y". The sanest thing to do is likely to make ovl match what a non-ovl setup would do in the same situation (_either_ of the overlaid filesystems - there might be multiple cases). But I'm missing the original report. It sounds like there was a regression and we already have a case of "changing the error number broke something". If so, that regression should be fixed. In general, I'm perfectly happy with people fixing error numbers and changing them. The only thing I require is that if those cleanups and fixes are reported to break something, people quickly revert (and preferably add a big comment about "Use *this* error number, because while this *other* error number would make sense, application XyZ expects AbC"..) Linus