Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1197663imm; Wed, 17 Oct 2018 15:17:45 -0700 (PDT) X-Google-Smtp-Source: ACcGV61izK4PaK3/kaNG87iINv7fkHLdV33xge6hOTrxQssPE7Swd1t3pLUxteElu6M9ES4uuBGJ X-Received: by 2002:a63:2b58:: with SMTP id r85-v6mr25687849pgr.432.1539814665925; Wed, 17 Oct 2018 15:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539814665; cv=none; d=google.com; s=arc-20160816; b=QOtKAtMgLhFmsybTmvWVGCOzjfrWmj4E7GRuamZumUcJubvfLe+WxgNYZsBxpMr61l BGRvcL/WQXlvJlsZY6tnf7lTEJxJLIeco7982lGe/OFdzun7UCT5ltPrmz55vWuqJzVg W3yOdQ0GmYwPUQrVPnSOkQF9mBGDVryUMKSm1eDHMPdy3JrFcCh4JciiRwwzA2u0gi2c BHKQBrRrckv5CU1zcaWxGx07WrsvxOqg/ZJz8qhAMRaMftPZRaoKP7Ym7yievn3A6LP+ kjtxMtZe+E0qJVOP8db0JGRMWemKY5PAB6l8n5vWOso02E21KC3sZlLA62Vd1hDeYTi/ DG5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=a6gNPQuA8wjAYjUFtN6tALZQinYGmG/L6svoW1XvOXg=; b=syQbUXG2HGjuJau+aEDTqlIfrseb++Ws6eOcMG7Gz5wMDv10YF1k+ZbY3fEdc4aKAu N9IJn4JKQPGnXVnP72sBwEHipYsC8/XGkVf7wCqbEotpRKlug4MQsBceEq5QaTY3xb7i nTS662/vrvm9AcYlPv8tw/f/M/ytFyVQ88QfoGTABgQHCEjIusZuS3QELmzepMMZ9BeJ 9ecoNSvQY6+/1Vz8YUdMD3Y6Yr+Ltlpc4UW7Pij0v2ykWEp88+i2HMooJOjLrIEBmrSQ N1dHyzwC17grMwD0jMsKHQ5enxBM2pSQStSg8TxRQaVGmgVGqdDPYzXSgxPWSTUsuSEk VQrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UOTjXQv3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38-v6si19482919pgb.30.2018.10.17.15.17.29; Wed, 17 Oct 2018 15:17:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UOTjXQv3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727350AbeJRGNI (ORCPT + 99 others); Thu, 18 Oct 2018 02:13:08 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:33045 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726334AbeJRGNI (ORCPT ); Thu, 18 Oct 2018 02:13:08 -0400 Received: by mail-yw1-f68.google.com with SMTP id m127-v6so11036065ywb.0; Wed, 17 Oct 2018 15:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a6gNPQuA8wjAYjUFtN6tALZQinYGmG/L6svoW1XvOXg=; b=UOTjXQv36ESUeeaV5SEQVXnQYLeTATGS8j+2FrVEf/g7k6IMynZNxomwEeHJNXvsLg B4wAeEta5vbHIuZ0fCfrdszdN7CIyRli1OX1P6S26bme2slZ8mnnHx2H9HOV/Gdq8Tdp rTu5QYnarGRmhbfrGosGFRHmdyF5CkJW3oylfcWNZ62HldG4sMWXgY+IKjBpmygcCLNu QZESKuvBF8sLbyyclfl3SRas/f7TFJsoVx9f6l6gtlOQhYuESFFtj4rxhIc8T+Nh2+c4 5Hxb/zXfH64ymYTrthvGcezKXjHEsRmm20MA2ft/4WUWVY714AY/W5SscFbr2RnE5XpQ b40w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a6gNPQuA8wjAYjUFtN6tALZQinYGmG/L6svoW1XvOXg=; b=silA9IjzMiIR9ougp4QfzuzVatGR3v4tQd8DU4j/VlYkXsD3tnzVWjj5pDajEF0UX6 bscobOJcBR2Zv+YFyBLyDi0o3nywK1D2R9xXAGuqCv8pWnofrJOZEcVbngDmgtlyh6zB WhjLc1rANj9nLFkv+h+AqtiSyUar+bEFVQO+yLcbJxJLr8+CKqYLOz4MQF4PE7wxTZz8 /DCrHMDZXgDNoBfETSl0TVEPoiqI3+gwLbyHQd+0o1e2WZUh0nyygD5aNhjVdhGaq12a hrJQ5pOmrJkEtjkOG7tBMnb4eEtlzUetYDZO1NjnPkT6jczLzlIKdZS2YBwFc53du9M5 u04w== X-Gm-Message-State: ABuFfojYBzhroy64jBpKLujCYaLr38jDJsldPJopTQwb5tSokU0XopmH tWVomXkmjGooXQD8LdWnyLx/xw2qRolw2y17Oro= X-Received: by 2002:a0d:c947:: with SMTP id l68-v6mr16732891ywd.404.1539814524342; Wed, 17 Oct 2018 15:15:24 -0700 (PDT) MIME-Version: 1.0 References: <006890C4-64D4-4DE2-A1F0-335FFFD585BB@dilger.ca> In-Reply-To: From: Amir Goldstein Date: Thu, 18 Oct 2018 01:15:13 +0300 Message-ID: Subject: Re: statx(2) API and documentation To: Miklos Szeredi Cc: Andreas Dilger , "Michael Kerrisk (man-pages)" , David Howells , linux-fsdevel , linux-kernel , linux-api@vger.kernel.org, Jan Kara Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 17, 2018 at 10:12 PM Miklos Szeredi wrote: > >> - STATX_ALL definition is unclear, can this change, or is it fixed? > >> If it's the former, than that's a backward compatibility nightmare. > >> If it's the latter, then what's the point? > > > > The value can change over time. It is intended to reflect the current > > state of affairs at the time the userspace program and kernel are compiled. > > The value sent from userspace lets the kernel know what fields are in > > the userspace struct, so it doesn't try to set fields that aren't there. > > What's the point of a userspace program specifying STATX_ALL? Without > a way to programmatically query the interface definition it's useless: > there's no way to guess which mask bit corresponds to which field, and > what that field represents. > > And there will be programs out there which specify STATX_ALL without > considering that in the future it may become slower as it is now due > to a recompile. > > So what's the point exactly? > > > The value in the kernel allows masking off new fields from userspace that > > it doesn't understand. > > Okay, but that has nothing to do with the UAPI. Even as an internal > flag we should be careful, as it might grow uses which can have > similar issues as the userspace one above. > FYI, I identified a similar anti-pattern in fanotify UAPI when I wanted to add new flags and did not want to change the UAPI _ALL_ constants. This is how we plan to solve it: https://github.com/amir73il/linux/commit/8c2b1acadb88ee4505ccc8bfdc665863111fb4cc Thanks, Amir.