From: Miklos Szeredi <miklos@szeredi.hu>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH] ovl: relax WARN_ON() when decoding lower directory file handle
Date: Wed, 15 Jul 2020 21:40:09 +0200 [thread overview]
Message-ID: <CAJfpegu3AyjLby6a+WAm7M8_FrdOjE=0dKMhLdbDApn5gkvgGA@mail.gmail.com> (raw)
In-Reply-To: <20200617065711.3784-1-amir73il@gmail.com>
On Wed, Jun 17, 2020 at 8:57 AM Amir Goldstein <amir73il@gmail.com> wrote:
>
> Decoding a lower directory file handle to overlay path with cold
> inode/dentry cache may go as follows:
>
> 1. Decode real lower file handle to lower dir path
> 2. Check if lower dir is indexed (was copied up)
> 3. If indexed, get the upper dir path from index
> 4. Lookup upper dir path in overlay
> 5. If overlay path found, verify that overlay lower is the lower dir
> from step 1
>
> On failure to verify step 5 above, user will get an ESTALE error and
> a WARN_ON will be printed.
>
> A mismatch in step 5 could be a result of lower directory that was renamed
> while overlay was offline, after that lower directory has been copied
> up and indexed.
>
> This is a scripted reproducer based on xfstest overlay/052:
>
> # Create lower subdir
> create_dirs
> create_test_files $lower/lowertestdir/subdir
> mount_dirs
> # Copy up lower dir and encode lower subdir file handle
> touch $SCRATCH_MNT/lowertestdir
> test_file_handles $SCRATCH_MNT/lowertestdir/subdir -p -o $tmp.fhandle
> # Rename lower dir offline
> unmount_dirs
> mv $lower/lowertestdir $lower/lowertestdir.new/
> mount_dirs
> # Attempt to decode lower subdir file handle
> test_file_handles $SCRATCH_MNT -p -i $tmp.fhandle
>
> Since this WARN_ON() can be triggered by user we need to relax it.
>
> Fixes: 4b91c30a5a19 ("ovl: lookup connected ancestor of dir in inode...")
> Cc: <stable@vger.kernel.org> # v4.16+
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Applied, thanks.
Miklos
prev parent reply other threads:[~2020-07-15 19:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 6:57 [PATCH] ovl: relax WARN_ON() when decoding lower directory file handle Amir Goldstein
2020-07-15 19:40 ` Miklos Szeredi [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='CAJfpegu3AyjLby6a+WAm7M8_FrdOjE=0dKMhLdbDApn5gkvgGA@mail.gmail.com' \
--to=miklos@szeredi.hu \
--cc=amir73il@gmail.com \
--cc=linux-unionfs@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 NNTP newsgroup(s).