From: "Holger Hoffstätte" <holger.hoffstaette@googlemail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: don't ignore log btree writeback errors
Date: Thu, 13 Nov 2014 17:43:12 +0000 (UTC) [thread overview]
Message-ID: <pan.2014.11.13.17.43.12@googlemail.com> (raw)
In-Reply-To: pan.2014.11.13.17.33.19@googlemail.com
On Thu, 13 Nov 2014 17:33:19 +0000, Holger Hoffstätte wrote:
> On Thu, 13 Nov 2014 16:59:53 +0000, Filipe Manana wrote:
>
>> If an error happens during writeback of log btree extents, make sure the
>> error is returned to the caller (fsync), so that it takes proper action
>> (commit current transaction) instead of writing a superblock that points
>> to log btrees with all or some nodes that weren't durably persisted.
>>
>> Signed-off-by: Filipe Manana <fdmanana@suse.com>
>> ---
>> fs/btrfs/tree-log.c | 21 +++++++++++++++------
>> 1 file changed, 15 insertions(+), 6 deletions(-)
>>
>> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
>> index 6d58d72..c8274d3 100644
>> --- a/fs/btrfs/tree-log.c
>> +++ b/fs/btrfs/tree-log.c
>> @@ -2599,12 +2599,14 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
>> index2 = root_log_ctx.log_transid % 2;
>> if (atomic_read(&log_root_tree->log_commit[index2])) {
>> blk_finish_plug(&plug);
>> - btrfs_wait_marked_extents(log, &log->dirty_log_pages, mark);
>> + ret = btrfs_wait_marked_extents(log, &log->dirty_log_pages,
>> + mark);
>> wait_log_commit(trans, log_root_tree,
>> root_log_ctx.log_transid);
>> btrfs_free_logged_extents(log, log_transid);
>> mutex_unlock(&log_root_tree->log_mutex);
>> - ret = root_log_ctx.log_ret;
>> + if (!ret)
>> + ret = root_log_ctx.log_ret;
>> goto out;
>> }
>> ASSERT(root_log_ctx.log_transid == log_root_tree->log_transid);
>
> This first hunk didn't apply to my 3.14.x tree that is 99.999% in sync with
> btrfs-3.18+, as a line is missing from the context. See:
>
> https://git.kernel.org/cgit/linux/kernel/git/mason/linux-btrfs.git/tree/fs/btrfs/tree-log.c?h=for-linus#n2605
>
> Any idea where that missing btrfs_free_logged_extents() went?
Found it: it went away with Josef's recent patch on Nov 6:
"Btrfs: make sure we wait on logged extents when fsycning two subvols"
(http://permalink.gmane.org/gmane.comp.file-systems.btrfs/40005)
..which I have applied. boohoo.
That patch also adds another call to btrfs_wait_marked_extents(), which should
then probably also have its return value handled?
thanks,
Holger
next prev parent reply other threads:[~2014-11-13 17:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 16:59 [PATCH] Btrfs: don't ignore log btree writeback errors Filipe Manana
2014-11-13 17:33 ` Holger Hoffstätte
2014-11-13 17:43 ` Holger Hoffstätte [this message]
2014-11-13 17:50 ` Filipe David Manana
2014-11-13 18:01 ` Holger Hoffstätte
2014-11-13 17:47 ` Filipe David Manana
2014-11-13 18:06 ` Holger Hoffstätte
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.2014.11.13.17.43.12@googlemail.com \
--to=holger.hoffstaette@googlemail.com \
--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