From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: 4.2.6: livelock in recovery (free_reloc_roots)?
Date: Sat, 21 Nov 2015 07:16:40 +0000 (UTC) [thread overview]
Message-ID: <pan$3f62e$32bded6f$af93867e$b809a854@cox.net> (raw)
In-Reply-To: 564FBCD1.1020009@lukas-pirl.de
Lukas Pirl posted on Sat, 21 Nov 2015 13:37:37 +1300 as excerpted:
> Can "btrfs_recover_relocation" prevented from being run? I would not
> mind losing a few recent writes (what was a balance) but instead going
> rw again, so I can restart a balance.
I'm not familiar with that thread name (I run multiple small btrfs on
ssds, so scrub, balance, etc, take only a few minutes at most), but if
it's the balance thread, then yes, there's a mount option that cancels a
running balance. See the wiki page covering mount options.
> From what I have read, btrfs-zero-log would not help in this case (?) so
> I did not run it so far.
Correct. Btrfs is atomic at commit time, so doesn't need a journal in
the sense of older filesystems like reiserfs, jfs and ext3/4.
What's this log, then? While btrfs won't fully write normal file writes
until a commit (every 30 seconds by default, there's a mount option...),
which is atomic (with copy-on-write helping here) so in the event of a
crash either the before or after state is returned, not something half
written, fsync is different. That says don't return until the file is
written to storage. But if a commit is done to ensure that, there may be
far more data to commit that otherwise doesn't need to be committed yet,
seriously slowing things down. So that's where this log comes in. It's
purely a log of fsynced data (and perhaps a few other similar things, I'm
not a dev and am not sure) between atomic commits, so the fsync can
return quickly while still having actually written the data to store,
without having to wait upto 30 seconds (by default) for the normal commit
to complete, or forcing a commit, along with everything else half
written, early.
There was a bug at one point where this log could be corrupted and thus
couldn't be written properly at mount, but the primary trigger bug for
that problem is long since fixed, so while there's various hardware bugs
and etc that could still by remote chance cause problems, thus the option
to zero the log, it's a very rare occurrence, and the trace when it fails
is telltale enough that if it's posted the devs can tell you to run the
zero-log command then. Otherwise, it generally does no good, and while
it generally does no serious harm beyond the loss of a few seconds worth
of fsyncs, etc, either, because the commits /are/ atomic and zeroing the
log simply returns the system to the state of such a commit, it's not
recommended as it /does/ needlessly kill the log of those last few
seconds of fsyncs.
> By the way, I can confirm the defect of 'btrfs device remove missing …"
> mentioned here: http://www.spinics.net/lists/linux-btrfs/msg48383.html :
>
> $ btrfs device delete missing
> /mnt/data ERROR: missing is not a block device
> $ btrfs device delete 5
> /mnt/data ERROR: 5 is not a block device
That's a known bug, with patches working their way thru the system both
to provide a different alternative and to let btrfs device delete missing
work again, but IDR the specific status of those patches. Presumably
they'll be in 4.4, but I don't know if they made it into 4.3 or not and
don't feel like looking it up ATM when you could do so just as easily.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
next prev parent reply other threads:[~2015-11-21 7:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 9:04 4.2.6: livelock in recovery (free_reloc_roots)? Lukas Pirl
2015-11-21 0:37 ` Lukas Pirl
2015-11-21 7:16 ` Duncan [this message]
2015-11-21 9:01 ` Alexander Fougner
2015-11-21 9:38 ` Lukas Pirl
2015-11-21 11:18 ` Lukas Pirl
2016-03-02 12:56 ` Still in 4.4.0: livelock in recovery (free_reloc_roots) Lukas Pirl
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='pan$3f62e$32bded6f$af93867e$b809a854@cox.net' \
--to=1i5t5.duncan@cox.net \
--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 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.