From patchwork Fri Oct 19 12:20:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10649205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A2C23109C for ; Fri, 19 Oct 2018 12:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F866283FF for ; Fri, 19 Oct 2018 12:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8378D28922; Fri, 19 Oct 2018 12:21:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AA3C283FF for ; Fri, 19 Oct 2018 12:21:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727358AbeJSU0v (ORCPT ); Fri, 19 Oct 2018 16:26:51 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41804 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727323AbeJSU0v (ORCPT ); Fri, 19 Oct 2018 16:26:51 -0400 Received: by mail-wr1-f66.google.com with SMTP id q7-v6so9369318wrr.8 for ; Fri, 19 Oct 2018 05:20:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DI3eyO7hOOE8k7ziSgipDwQ5lk17cCZDpBqUZ5GEV1w=; b=uBJuGczRgmeHr3mY97bYo0MUrA7vVq5RcwmTqLd5Q1ZysLViV8FkTUEfmR7IrGY0YU pf4qoLmu5CQXEWVxpcdLqTsOqJPptrljbMryI7X8vBntKgdgLcyTLfFaKJm5ihIoVnzY 6FeePYcwAqEDRwjAgvpI9k4NE4ymZmto+/4lNEf6XSO8pyGjasT+fPxAAI0QJ7yhgLcB PwnVIzCm/OXDYL6HHnZFYpBnaWSTXp/szk/WxgPy6thhDQ02J2lB3kZFGUiiSuQYNOK/ k3YgtIXZIrwE4vjNFuYqM2rRUPDaH6TWv1qTqBdvlBRqIougB48fJWPsooAEZ8q32N05 DnNQ== X-Gm-Message-State: ABuFfogRIYv2pm/MusuJfRHC7+6weW9J2e6QFLIQ4JYu5fKOXW6dqdSc Jjk1cnYr2NuYTu8D/IKRgxgT4qK2+Jw= X-Google-Smtp-Source: ACcGV634JBN7TrHiFqPsGayChQBFFmQa8RGgGFJh/Kxux8CHobnJ/MYVFEkq4LZWmC3pv7dqWNsz7Q== X-Received: by 2002:adf:ef90:: with SMTP id d16-v6mr28773996wro.204.1539951658316; Fri, 19 Oct 2018 05:20:58 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id s10-v6sm1858283wmf.15.2018.10.19.05.20.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 05:20:57 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, David Howells , Michael Kerrisk , Andreas Dilger , Florian Weimer , Amir Goldstein Subject: [PATCH v2 4/5] statx: don't clear STATX_ATIME on SB_RDONLY Date: Fri, 19 Oct 2018 14:20:48 +0200 Message-Id: <20181019122049.27121-4-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20181019122049.27121-1-mszeredi@redhat.com> References: <20181019122049.27121-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP IS_NOATIME(inode) is defined as __IS_FLG(inode, SB_RDONLY|SB_NOATIME), so generic_fillattr() will clear STATX_ATIME from the result_mask if the super block is marked read only. This was probably not the intention, so fix to only clear STATX_ATIME if the fs doesn't support atime at all. Signed-off-by: Miklos Szeredi Cc: David Howells Acked-by: David Howells --- fs/stat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/stat.c b/fs/stat.c index 8d297a279991..b46583df70d4 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -46,7 +46,8 @@ void generic_fillattr(struct inode *inode, struct kstat *stat) stat->blksize = i_blocksize(inode); stat->blocks = inode->i_blocks; - if (IS_NOATIME(inode)) + /* SB_NOATIME means filesystem supplies dummy atime value */ + if (inode->i_sb->s_flags & SB_NOATIME) stat->result_mask &= ~STATX_ATIME; if (IS_AUTOMOUNT(inode)) stat->attributes |= STATX_ATTR_AUTOMOUNT;