linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>,
	fstests@vger.kernel.org,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH 1/2] fstests: generic test for directory fsync after rename operation
Date: Thu, 18 Feb 2016 08:43:41 -0800	[thread overview]
Message-ID: <20160218164341.GI6346@birch.djwong.org> (raw)
In-Reply-To: <CAL3q7H4oF1adZX+TRC_V0HZEkBmLcC-26kBzJtR9Yj3+8FSBoA@mail.gmail.com>

On Thu, Feb 18, 2016 at 01:38:41PM +0000, Filipe Manana wrote:
> On Thu, Feb 18, 2016 at 1:30 AM, Dave Chinner <david@fromorbit.com> wrote:
> > On Mon, Feb 15, 2016 at 10:54:23AM +0000, fdmanana@kernel.org wrote:
> >> From: Filipe Manana <fdmanana@suse.com>
> >>
> >> Test that if we move one file between directories, fsync the parent
> >> directory of the old directory, power fail and remount the filesystem,
> >> the file is not lost and it's located at the destination directory.
> >>
> >> This is motivated by a bug found in btrfs, which is fixed by the patch
> >> (for the linux kernel) titled:
> >>
> >>   "Btrfs: fix file loss on log replay after renaming a file and fsync"
> >>
> >> Tested against ext3, ext4, xfs, f2fs and reiserfs.
> >>
> >> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> > ....
> >> +# We expect our file foo to exist, have an entry in the new parent
> >> +# directory (c/) and not have anymore an entry in the old parent directory
> >> +# (a/b/).
> >> +[ -e $SCRATCH_MNT/a/b/foo ] && echo "File foo is still at directory a/b/"
> >> +[ -e $SCRATCH_MNT/c/foo ] || echo "File foo is not at directory c/"
> >> +
> >> +# The new file named bar should also exist.
> >> +[ -e $SCRATCH_MNT/a/bar ] || echo "File bar is missing"
> >
> > This can all be replaced simply by:
> >
> > ls -R $SCRATCH_MNT | _filter_scratch
> >
> > Because the golden image match will tell us if files are missing or
> > in the wrong place.
> 
> The problem with that is ext3/4 have the lost+found directory that
> xfs, btrfs, etc don't have.

XFS can have lost+found too, though this seems unlikely on the scratch mount.

> Do you mind about something like this:
> 
> # exclude lost+found directory specific to some filesystems (ext3/4)
> ls -R $SCRATCH_MNT | grep -v 'lost+found' | tr -s '\n' | _filter_scratch

Why not put "a" and "c" under $SCRATCH_MNT/test-335/?

--D

> 
> (since you usually dislike generic tests having any specific logic for
> specific filesystems)
> 
> Also do I need to remove _need_to_be_root for the 3 tests I submitted?
> I only noticed there was a submitted patch that kills that function
> after sending them.
> 
> thanks
> 
> 
> >
> > Cheers,
> >
> > Dave.
> > --
> > Dave Chinner
> > david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-02-18 16:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15 10:54 [PATCH 1/2] fstests: generic test for directory fsync after rename operation fdmanana
2016-02-18  1:30 ` Dave Chinner
2016-02-18 13:38   ` Filipe Manana
2016-02-18 16:43     ` Darrick J. Wong [this message]
2016-02-18 16:48       ` Filipe Manana
2016-02-18 23:09 ` [PATCH 1/2 v2] " fdmanana
  -- strict thread matches above, loose matches on Subject: below --
2016-02-12 16:20 [PATCH 1/2] " fdmanana

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=20160218164341.GI6346@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@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).