From: Dave Chinner <david@fromorbit.com>
To: Josef Bacik <jbacik@fb.com>
Cc: linux-btrfs@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] Btrfs: do not move em to modified list when unpinning
Date: Wed, 19 Nov 2014 14:45:56 +1100 [thread overview]
Message-ID: <20141119034556.GG29950@dastard> (raw)
In-Reply-To: <1415999790-4144-1-git-send-email-jbacik@fb.com>
On Fri, Nov 14, 2014 at 04:16:30PM -0500, Josef Bacik wrote:
> We use the modified list to keep track of which extents have been modified so we
> know which ones are candidates for logging at fsync() time. Newly modified
> extents are added to the list at modification time, around the same time the
> ordered extent is created. We do this so that we don't have to wait for ordered
> extents to complete before we know what we need to log. The problem is when
> something like this happens
>
> log extent 0-4k on inode 1
> copy csum for 0-4k from ordered extent into log
> sync log
> commit transaction
> log some other extent on inode 1
> ordered extent for 0-4k completes and adds itself onto modified list again
> log changed extents
> see ordered extent for 0-4k has already been logged
> at this point we assume the csum has been copied
> sync log
> crash
>
> On replay we will see the extent 0-4k in the log, drop the original 0-4k extent
> which is the same one that we are replaying which also drops the csum, and then
> we won't find the csum in the log for that bytenr. This of course causes us to
> have errors about not having csums for certain ranges of our inode. So remove
> the modified list manipulation in unpin_extent_cache, any modified extents
> should have been added well before now, and we don't want them re-logged. This
> fixes my test that I could reliably reproduce this problem with. Thanks,
Is it possiible to turn this unspecified test in into another
generic fsync xfstest?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2014-11-19 3:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 21:16 [PATCH] Btrfs: do not move em to modified list when unpinning Josef Bacik
2014-11-18 7:13 ` Liu Bo
2014-11-18 16:03 ` Josef Bacik
2014-11-19 3:45 ` Dave Chinner [this message]
2014-11-19 14:57 ` Josef Bacik
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=20141119034556.GG29950@dastard \
--to=david@fromorbit.com \
--cc=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=stable@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.