Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp321327pxu; Tue, 1 Dec 2020 12:06:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxs+k5Wh7XM2J+zLvVDmce3cSAVnbjpuUagtn1mSrSveA3R7fmzrfQSIRkH8+OSm8iASNWL X-Received: by 2002:a19:8406:: with SMTP id g6mr2020843lfd.141.1606853217779; Tue, 01 Dec 2020 12:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606853217; cv=none; d=google.com; s=arc-20160816; b=UFkF/8GMT5aq82l4ee+EyVdQX2LbCUdDlwdWOh3C6WVXgwzn6+kpDDyp6biIQw8n0W IRuoSd7nB+2RE2yiCkUS0Jga13gpNFUwuco+T+O/cPpFfQ/2S/MnIkNju2T4GJ5ozhZW 9J14aDw8MBu9hS+ijXloC26/ELxOQtvhwXpemIZggV5zkZe/73Pv8/+6c774hE171h8b jWXzfVqTQFUzatf19zAm3ZmNO69iOlItvIYEd/vnIe+RSOYHAlzp7rELI8JWSAZOX+Bs fyfsnLXXoei9pEVs4IAm8oV8XuAHKBNr1Kt1nKjhgf4KeCeMbomCs4qQvIVg3G9abQlO ZXow== 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=HEphcGQwY2jeNYDME47hDdQV9bR2WcuThTyY8CTMagA=; b=RQAS2fCVXGO6qy/DJW3j9PgXuDrmGC6ifeWIa0r0kpS2bdVH8T1c7S+Asw2owS/2Ey FyeZMkETPM0euvwl9YRyMiH9EbXBXkv4yHhvtZDk6mHLc1uV0hZI5pd79VWLRXFKoB2j 9pNzerf162+UMFWoyouOzB/6K7/kjJh8XHCDStB5P5SjGUPxFkumLlmZ6hlrlOsOgV4R ZVstqCGIIq6N19MBFuLnA+vnC0xs2elxsru+CZe2uhhEQQi2s+GXLhTPYjkAV20V+XZ8 ZbWPkaeX2cF79IqpgGViRvtgECOZq5xWbY0LD9a0sG8LM/KahnMAJkNgm8WhJqrkaL+5 ZatA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=f+XordXx; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si666863ejs.13.2020.12.01.12.06.23; Tue, 01 Dec 2020 12:06:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=f+XordXx; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727684AbgLAUF5 (ORCPT + 99 others); Tue, 1 Dec 2020 15:05:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730556AbgLAUF5 (ORCPT ); Tue, 1 Dec 2020 15:05:57 -0500 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46F5C0617A7 for ; Tue, 1 Dec 2020 12:05:16 -0800 (PST) Received: by mail-lj1-x242.google.com with SMTP id y16so5186130ljk.1 for ; Tue, 01 Dec 2020 12:05:16 -0800 (PST) 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=HEphcGQwY2jeNYDME47hDdQV9bR2WcuThTyY8CTMagA=; b=f+XordXx1HtHQauAu4wnySGZ7GOsfsrQOPdsZpcQHvfL87zHN51ik0PwYfToHQidR0 PlZ/E4mqzBriHmbzSkQser0B1m99iGnRC3rEB7nXytmUcWTvmQp/DGH5GienWzwN/RKd ej/bdilwW2TBGDr+jCbzKtRZ0888o0ynwCvig= 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=HEphcGQwY2jeNYDME47hDdQV9bR2WcuThTyY8CTMagA=; b=Aa6pSwuRzSTYwpSnhYSZEnH78wpvgAKBE1/FwECVbxkDD+80A3GeOsi0X1skBZkOGy cNAY63SzE1p7OUsY0zrhU0ioKTrriFl3HKdNWp35xy7z/9ilhZeMz+SDgFCE0vQjdv9U sSuofUJWzrpz+6zr6T9vujzRXKXcjteEW13FErYl81H1N7o/9W1oWWhhpP/n5N6r3SRx GL4wnRcewVFqj4bK/DJuK9eo2TA/eNGOCJ2LJwsEkLFI1tj8JbRX5TMcO2eg8ZAiRjLG nd3YKsIgiZWEwXFdSVPbJtsi103vxBuVOHTlDce6FOjMC0M1qZnPv6v+8+eQCN828/oB uvfw== X-Gm-Message-State: AOAM530DHzo5pSCH78B6r49Pksge+FlBxOvlugtE4NnZ2s0pl/X3YZNA 9uTe9lWza8x+fn5INRs3FLKih08eOwp0Uw== X-Received: by 2002:a2e:878c:: with SMTP id n12mr2151021lji.319.1606853114270; Tue, 01 Dec 2020 12:05:14 -0800 (PST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id v17sm70077lfa.81.2020.12.01.12.05.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2020 12:05:13 -0800 (PST) Received: by mail-lf1-f48.google.com with SMTP id v14so6961126lfo.3 for ; Tue, 01 Dec 2020 12:05:13 -0800 (PST) X-Received: by 2002:a19:5003:: with SMTP id e3mr1997442lfb.148.1606853112635; Tue, 01 Dec 2020 12:05:12 -0800 (PST) MIME-Version: 1.0 References: <05a0f4fd-7f62-8fbc-378d-886ccd5b3f11@redhat.com> In-Reply-To: <05a0f4fd-7f62-8fbc-378d-886ccd5b3f11@redhat.com> From: Linus Torvalds Date: Tue, 1 Dec 2020 12:04:56 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] statx: move STATX_ATTR_DAX attribute handling to filesystems To: Eric Sandeen Cc: Miklos Szeredi , Ira Weiny , David Howells , linux-fsdevel , linux-man , Linux Kernel Mailing List , xfs , Ext4 Developers List , Xiaoli Feng Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Dec 1, 2020 at 8:59 AM Eric Sandeen wrote: > > It's a bit odd to set STATX_ATTR_DAX into the statx attributes in the VFS; > while the VFS can detect the current DAX state, it is the filesystem which > actually sets S_DAX on the inode, and the filesystem is the place that > knows whether DAX is something that the "filesystem actually supports" [1] > so that the statx attributes_mask can be properly set. > > So, move STATX_ATTR_DAX attribute setting to the individual dax-capable > filesystems, and update the attributes_mask there as well. I'm not really understanding the logic behind this. The whole IS_DAX(inode) thing exists in various places outside the low-level filesystem, why shouldn't stat() do this? If IS_DAX() is incorrect, then we have much bigger problems than some stat results. We have core functions like generic_file_read_iter() etc all making actual behavioral judgements on IS_DAX(). And if IS_DAX() is correct, then why shouldn't this just be done in generic code? Why move it to every individual filesystem? Linus