Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3108483imm; Fri, 19 Oct 2018 05:22:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV61zdNnfiT7q0IoZwGqV3qwGFwFX7tFhDEAz6Jf95Pgd0GeNd0005PPQe/EpWHZ+3AWzGNrj X-Received: by 2002:a63:24f:: with SMTP id 76-v6mr31825523pgc.67.1539951734163; Fri, 19 Oct 2018 05:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539951734; cv=none; d=google.com; s=arc-20160816; b=rjIKhLsZskNwut+PZDlIx3Ck0RtuThwz7wx/f3Gbi+ZgAddNeM96k/FnVDRvDGYqQb FvLvBuOMZ7llqRZ3GTSMQ5NhifbNzXo83pdmNKppiE3KsGE90VBxzZfuhlx4UEfKW0Nx MRuO20kOg+dN9/nWeZBjfviofcVWN2tLqT0FQrmqyi8DwVS6sTcwMST0L3XkKms7yy5S 4xqUwfouTerG7KSOlgGyr7xrqLkrc788zVHoortSiyD8HtuyiGATwpFEpMhe1mECmeBw 0fMY47s+FV86jO4n38AfQVC81SDzqhmp1eFZ9EHbScTHk+HxAYWO98fRtHAuSLTd+A1G 7WcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=DI3eyO7hOOE8k7ziSgipDwQ5lk17cCZDpBqUZ5GEV1w=; b=XN7df8XfxtheMNIGZalTj5DqmiGbSg2ZFwTP+tH+QoccuDS5dzdrmsAmb/f7cBqGcB gCIUeTw4ULxEgxqYI6TfbOGbgL9EgfU5Vveu8Z8zKfDlepCNKmrlFUtDERDwGt9Yxx4s J1VIOzbk001AxbhUlnCVt39fg05k52TzvxE14D/QpZAZy7sjW85kCb6R1fEZolii0qh9 xDNhuk7HZluI26TdSlGgL4fmgnP+WUwOyFk7x7H+e3tGmPopte1Hj5msFIAklOkd+L50 TtuENzbX1zxic8Jh2YtytMY8hU0vn1DPeX/CBWrbUqF6TZbHtwhUAfPjWkzyZ5UvlFV1 nrzQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15-v6si24347730pgk.103.2018.10.19.05.21.59; Fri, 19 Oct 2018 05:22:14 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727370AbeJSU0v (ORCPT + 99 others); Fri, 19 Oct 2018 16:26:51 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39105 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727308AbeJSU0v (ORCPT ); Fri, 19 Oct 2018 16:26:51 -0400 Received: by mail-wr1-f65.google.com with SMTP id 61-v6so37208925wrb.6 for ; Fri, 19 Oct 2018 05:20:58 -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=ANpmYx+iUQ8iIzKPZzwHaGfFx3eYv7AM/srvGQ1n3BZ3yZXleUwUPbmxNfTKSzA6nz LfT7fZuBWj7J2a5SdOzG6ZfXvNHzUH+c7qHmvwBsf+mpymcdTkwcOlUh1hjRSJH3ke0X FKqoDWFIeK4DtppKKxGsxHm1qJ+OaXuXBNGy9fv4L0oqU2hWVzPYzFTklw1EOAwdCfDK JM29dDAiq8/b+Li7hIIjW2o7oXD9xX6hvwhixH2x5xutTL9Y7D8HFYg4Z8XEndScciRl 0HJ/9M65wtTkCRTenZvYOvEXxCzjJYzHsQ5IxwCixVtz3AiUhdPd0o41+QYix/JtrD2X b5Ng== X-Gm-Message-State: ABuFfohpCtj+FomikZd3Rutb/T62NfVN+kY/kWuF9IXM0eqoWqD68c/2 +wZwKxydHHRqvpJXx7Br9p99R+BaQhk= 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.14.3