From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: [PATCH] Btrfs-progs: fix a bug of converting sparse ext2/3/4
Date: Tue, 25 Nov 2014 17:35:52 +0800 [thread overview]
Message-ID: <1416908152-8367-1-git-send-email-bo.li.liu@oracle.com> (raw)
When converting a sparse ext* filesystem, btrfs-convert adds checksum extents
for empty extents, whose disk_bytenr = 0, and this can end up with some weird
problems, one of them is the failure of reading free space cache inode on
mounting converted btrfs.
The fix is simple, just to skip making checksum on empty extents.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
btrfs-convert.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/btrfs-convert.c b/btrfs-convert.c
index a544fc6..02c5e94 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -393,7 +393,7 @@ static int record_file_blocks(struct btrfs_trans_handle *trans,
ret = btrfs_record_file_extent(trans, root, objectid, inode, file_pos,
disk_bytenr, num_bytes);
- if (ret || !checksum)
+ if (ret || !checksum || disk_bytenr == 0)
return ret;
return csum_disk_extent(trans, root, disk_bytenr, num_bytes);
--
1.8.1.4
reply other threads:[~2014-11-25 9:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1416908152-8367-1-git-send-email-bo.li.liu@oracle.com \
--to=bo.li.liu@oracle.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;
as well as URLs for NNTP newsgroup(s).