From: Filipe Manana <fdmanana@kernel.org>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] libmount: Fix regression when mounting with atime
Date: Thu, 17 Aug 2023 10:57:34 +0100 [thread overview]
Message-ID: <CAL3q7H6RE2CmJTKc96EL34Nqmfw_=CQ22jJMoUwshA2TQXCMDw@mail.gmail.com> (raw)
In-Reply-To: <20230817095401.ystzfnqn5udsbrij@ws.net.home>
On Thu, Aug 17, 2023 at 10:54 AM Karel Zak <kzak@redhat.com> wrote:
>
> On Thu, Aug 17, 2023 at 10:20:13AM +0100, fdmanana@kernel.org wrote:
> > A regression was introduced in v2.39 that causes mounting with the atime
> > option to fail:
> >
> > $ mkfs.ext4 -F /dev/sdi
> > $ mount -o atime /dev/sdi /mnt/sdi
> > mount: /mnt/sdi: not mount point or bad option.
> > dmesg(1) may have more information after failed mount system call.
>
> Great timing! I just released bugfix tarball v2.39.2 a few minutes ago :-)
Ahaha yes!
I was supposed to send it yesterday, but I had to take some time to
figure out where to write a test case, so that's what took most of the
time actually :)
Thanks.
>
> > diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c
> > index e93810b47..d0afc94f7 100644
> > --- a/libmount/src/optlist.c
> > +++ b/libmount/src/optlist.c
> > @@ -875,7 +875,18 @@ int mnt_optlist_get_attrs(struct libmnt_optlist *ls, uint64_t *set, uint64_t *cl
> >
> > if (opt->ent->mask & MNT_INVERT) {
> > DBG(OPTLIST, ul_debugobj(ls, " clr: %s", opt->ent->name));
> > - *clr |= x;
> > + /*
> > + * All atime settings are mutually exclusive so *clr must
> > + * have MOUNT_ATTR__ATIME set.
> > + *
> > + * See the function fs/namespace.c:build_mount_kattr()
> > + * in the linux kernel source.
> > + */
> > + if (x == MOUNT_ATTR_RELATIME || x == MOUNT_ATTR_NOATIME ||
> > + x == MOUNT_ATTR_STRICTATIME)
> > + *clr |= MOUNT_ATTR__ATIME;
> > + else
> > + *clr |= x;
>
> Ah, the libmount code does this, but only when set a new option. This is
> missing for inverted options (like atime).
>
> > +# Test that the atime option works after the migration to use the new kernel mount APIs.
> > +ts_run $TESTPROG --mount -o atime $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
> > +$TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPUT 2>> $TS_ERRLOG
> > +is_mounted $DEVICE || echo "$DEVICE not mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG
> > +ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
> > +is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG
> > +
> > +ts_finalize_subtest
>
> Applied, thanks, and extra thanks for the tests!
>
> Karel
>
>
> --
> Karel Zak <kzak@redhat.com>
> http://karelzak.blogspot.com
>
prev parent reply other threads:[~2023-08-17 9:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 9:20 [PATCH] libmount: Fix regression when mounting with atime fdmanana
2023-08-17 9:54 ` Karel Zak
2023-08-17 9:57 ` Filipe Manana [this message]
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='CAL3q7H6RE2CmJTKc96EL34Nqmfw_=CQ22jJMoUwshA2TQXCMDw@mail.gmail.com' \
--to=fdmanana@kernel.org \
--cc=kzak@redhat.com \
--cc=util-linux@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 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 read-only IMAP folder(s) and NNTP newsgroup(s).