All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: guaneryu@gmail.com, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 2/3] common: fix _require_btime for lazy filesystems
Date: Mon, 11 Feb 2019 18:17:32 -0800	[thread overview]
Message-ID: <154993785290.1948.9192893627999402298.stgit@magnolia> (raw)
In-Reply-To: <154993784038.1948.7502664832930298472.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

Filesystems are not required to try to fill the statx btime field unless
the caller actually sets STATX_BTIME.  They're allowed to volunteer that
information "if it's cheap", but XFS doesn't volunteer and there may be
filesystems that support btime but not cheaply.

Either way, we want to test btime on any filesystem that supports it,
cheaply or otherwise, so set STATX_BTIME when we're trying to detect
support for it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/rc |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


diff --git a/common/rc b/common/rc
index ab468adf..6fb71e60 100644
--- a/common/rc
+++ b/common/rc
@@ -3849,7 +3849,11 @@ _dmsetup_create()
 
 _require_btime()
 {
-	$XFS_IO_PROG -f $TEST_DIR/test_creation_time -c "statx -v" \
+	# Note: filesystems are not required to report btime (creation time)
+	# if the caller doesn't ask for it, so we define STATX_BTIME here and
+	# pass it in to the statx command.
+	export STATX_BTIME=0x800
+	$XFS_IO_PROG -f $TEST_DIR/test_creation_time -c "statx -m $STATX_BTIME -v" \
 		| grep btime >>$seqres.full 2>&1 || \
 		_notrun "inode creation time not supported by this filesystem"
 	rm -f $TEST_DIR/test_creation_time

  parent reply	other threads:[~2019-02-12  2:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12  2:17 [PATCH 0/3] fstests: fixes and new tests Darrick J. Wong
2019-02-12  2:17 ` [PATCH 1/3] common: fix kmemleak to work with sections Darrick J. Wong
2019-02-12  2:17 ` Darrick J. Wong [this message]
2019-02-12  2:17 ` [PATCH 3/3] generic: check for reasonable inode creation time Darrick J. Wong
2019-02-13 20:48 ` [PATCH 4/3] generic: posix acl extended attribute memory corruption test Darrick J. Wong
2019-02-16 12:05   ` Eryu Guan
2019-02-16 17:24     ` Darrick J. Wong
2019-02-20 13:29   ` David Sterba
2019-02-20 14:09     ` Holger Hoffstätte
2019-02-20 18:58       ` Darrick J. Wong
2019-02-25 18:57   ` Jeff Mahoney
2019-02-25 21:00     ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=154993785290.1948.9192893627999402298.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.