fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: fstests <fstests@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Greg KH <gregkh@linuxfoundation.org>,
	Eryu Guan <guaneryu@gmail.com>, Sasha Levin <sashal@kernel.org>,
	y2038 Mailman List <y2038@lists.linaro.org>
Subject: Re: [PATCH v2] generic/402: Make timestamp range check conditional
Date: Mon, 30 Dec 2019 09:34:47 +0200	[thread overview]
Message-ID: <CAOQ4uxifpjjirTyUsCm03TFx8LOvkt0xX+RNyFZU5sHNU+bfqA@mail.gmail.com> (raw)
In-Reply-To: <20191228221317.16654-1-deepa.kernel@gmail.com>

On Sun, Dec 29, 2019 at 12:13 AM Deepa Dinamani <deepa.kernel@gmail.com> wrote:
>
> Addition of fs-specific timestamp range checking was added
> in 188d20bcd1eb ("vfs: Add file timestamp range support").
>
> Add a check for whether the kernel supports the limits check
> before running the associated test.
>
> ext4 has been chosen to test for the presence of kernel support
> for this feature. If there is a concern that ext4 could be built
> out of the kernel, I can include a _require_ext4() along the
> lines of _require_ext2().
>
> Suggested-by: Amir Goldstein <amir73il@gmail.com>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> ---
> * Changes since v1:
>   used loopback device instead of mkfs scratch dev
>
>  common/rc         | 26 ++++++++++++++++++++++++++
>  tests/generic/402 |  3 +++
>  2 files changed, 29 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index 816588d6..6248adf7 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1981,6 +1981,32 @@ _run_aiodio()
>      return $status
>  }
>
> +_require_kernel_timestamp_range()
> +{
> +       LOOP_FILE=$SCRATCH_MNT/loop_file
> +       LOOP_MNT=$SCRATCH_MNT/loop_mnt
> +
> +       dd if=/dev/zero of=$LOOP_FILE bs=1M count=2 2>&1 | _filter_dd || _fail "loopback prep failed"
> +
> +       # Use ext4 with 128-byte inodes, which do not have room for extended timestamp
> +       FSTYP=ext4 MKFS_OPTIONS=-I128 \
> +       _mkfs_dev $LOOP_FILE >> $seqres.full 2>&1 || _fail "ext4 mkfs failed"
> +
> +       LOOP_DEV=$(_create_loop_device $LOOP_FILE)
> +       mkdir -p $LOOP_MNT >> $seqres.full 2>&1 || _fail "failed to create $LOOP_MNT"
> +       mount -t ext4 ${LOOP_DEV} ${LOOP_MNT} >> $seqres.full 2>&1 || _fail "ext4 mount failed"
> +       notrun=false
> +       _check_dmesg_for "ext4 filesystem being mounted at ${LOOP_MNT} supports timestamps until 2038" || \
> +               notrun=true
> +
> +       umount ${LOOP_MNT} >> $seqres.full 2>&1 ||_fail "failed to umount $LOOP_MNT"
> +       _destroy_loop_device ${LOOP_DEV} >> $seqres.full 2>&1
> +
> +       if $notrun; then
> +               _notrun "Kernel does not support timestamp limits"
> +       fi
> +}
> +

As a generic helper, this function has a few problems:
1. It assumes scratch dev is mounted (and you're not even calling it
after _scratch_mount)
2. The cleanup() hook won't clean loop mnt/dev if interrupted
3. test doesn't have _require_loop (nor require ext4 as you mentioned)

All this leads me to think that perhaps it would be better off, at least until
kernel has fsinfo, to keep this entire helper inside generic/402,
while addressing
the issues above in the test itself.

A more generic solution would be harder and IMO and overkill at this point.

What do you think?

Thanks,
Amir.

  reply	other threads:[~2019-12-30  7:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19  4:12 [PATCH] generic/402: fix for updated behavior of timestamp limits Deepa Dinamani
2019-07-21 16:47 ` Eryu Guan
2019-10-02 22:06   ` Deepa Dinamani
2019-10-05 18:35 ` Eryu Guan
2019-10-23 22:17   ` Deepa Dinamani
2019-12-12 13:11 ` Amir Goldstein
2019-12-12 21:55   ` Deepa Dinamani
2019-12-18 20:21     ` Deepa Dinamani
2019-12-18 20:46       ` Amir Goldstein
2019-12-19  8:28         ` [Y2038] " Arnd Bergmann
2019-12-19  8:40           ` Greg KH
2019-12-19 11:29             ` Arnd Bergmann
2019-12-19 11:35               ` Greg KH
2019-12-19 15:48               ` Ben Hutchings
2019-12-19 20:35                 ` Arnd Bergmann
2019-12-19 12:09           ` Amir Goldstein
2019-12-20 22:45             ` Deepa Dinamani
2019-12-23  5:16               ` [PATCH] generic/402: Make timestamp range check conditional Deepa Dinamani
2019-12-23  6:36                 ` Amir Goldstein
2019-12-24  1:15                   ` Deepa Dinamani
2019-12-28 22:13                     ` [PATCH v2] " Deepa Dinamani
2019-12-30  7:34                       ` Amir Goldstein [this message]
2020-01-03  6:46                         ` Deepa Dinamani
2020-01-03  9:58                           ` Amir Goldstein
2020-01-08  8:09                         ` Eryu Guan
2020-01-08  8:45                           ` Amir Goldstein
2020-01-08  9:50                             ` Eryu Guan
2020-01-17  9:09                               ` Amir Goldstein
2020-01-17 18:23                                 ` Deepa Dinamani
2020-01-17 19:01                                   ` Deepa Dinamani
2020-01-19  0:57                                     ` [PATCH v3 1/1] " Deepa Dinamani
2020-01-19  9:19                                       ` Amir Goldstein
2020-02-01  9:14                                         ` Eryu Guan

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=CAOQ4uxifpjjirTyUsCm03TFx8LOvkt0xX+RNyFZU5sHNU+bfqA@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=arnd@arndb.de \
    --cc=deepa.kernel@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=guaneryu@gmail.com \
    --cc=sashal@kernel.org \
    --cc=y2038@lists.linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).