linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: jordan.j@mail.bg, linux-btrfs@vger.kernel.org
Subject: Re: btrfs-convert on 24Gb image corrupts files.
Date: Sun, 5 May 2024 10:20:02 +0930	[thread overview]
Message-ID: <10bac394-6b9d-4e07-a197-ccd06c16f781@gmx.com> (raw)
In-Reply-To: <d34c7d77a7f00c93bea6a4d6e83c7caf.mailbg@mail.bg>



在 2024/5/5 10:04, jordan.j@mail.bg 写道:
[...]
> *******
>
> on ext4:
>
> ilefrag -v
> m/root/.mozilla/firefox/s554srh9.default-release/storage/permanent/chrome/idb/3561288849sdhlie.sqlite
> Filesystem type is: ef53
> File size of
> m/root/.mozilla/firefox/s554srh9.default-release/storage/permanent/chrome/idb/3561288849sdhlie.sqlite is 49152 (12 blocks of 4096 bytes)
>   ext:     logical_offset:        physical_offset: length:   expected:
> flags:
>     0:        0..       1:    2217003..   2217004:      2:
>     1:        2..      10:    2217019..   2217027:      9:    2217005:
>     2:       11..      11:    2217028..   2217028:      1:
> last,unwritten,eof
> m/root/.mozilla/firefox/s554srh9.default-release/storage/permanent/chrome/idb/3561288849sdhlie.sqlite: 2 extents found
>
> on btrfs:
>
> filefrag -v
> k/root/.mozilla/firefox/s554srh9.default-release/storage/permanent/chrome/idb/3561288849sdhlie.sqlite
> Filesystem type is: 9123683e
> File size of
> k/root/.mozilla/firefox/s554srh9.default-release/storage/permanent/chrome/idb/3561288849sdhlie.sqlite is 49152 (12 blocks of 4096 bytes)
>   ext:     logical_offset:        physical_offset: length:   expected:
> flags:
>     0:        0..       1:    2217003..   2217004:      2:
> shared
>     1:        2..      11:    2217019..   2217028:     10:    2217005:
> last,shared,eof
> k/root/.mozilla/firefox/s554srh9.default-release/storage/permanent/chrome/idb/3561288849sdhlie.sqlite: 2 extents found
>

This is exactly the problem of unwritten (preallocated) extents.

Considering all corrupted files are from sqlite, it's highly possible
related to that.

> *********
>
> Tried the four patches from:
> https://lore.kernel.org/linux-btrfs/6d2a19ced4551bfcf2a5d841921af7f84c4ea950.1714722726.git.anand.jain@oracle.com/
>
> on the https://github.com/kdave/btrfs-progs.git tree - no change.

Unfortunately this means the fix is not working.

Mind to provide the "filefrag -v" output after conversion using Anand's
fixes?

I'm afraid there is something wrong for the fix.

For the worst case, I can go a simpler solution by just converting
preallocated extents to holes as a hot fix.

To me, there is no chance we can utilize the preallocated space anyway,
since the extent is shared with the ext4 image, thus we have to do COW.
So focusing on creating the same preallocated data extents in conversion
makes no sense.

Thanks,
Qu


  reply	other threads:[~2024-05-05  0:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-05  0:34 btrfs-convert on 24Gb image corrupts files jordan.j
2024-05-05  0:50 ` Qu Wenruo [this message]
2024-05-05  0:56 ` Anand Jain
2024-05-05  5:54   ` Qu Wenruo
2024-05-06  0:33     ` Anand Jain
2024-05-05 15:05 Yordan
2024-05-05 22:31 ` Qu Wenruo
2024-05-05 22:30 You can reproduce it yourself now Yordan
2024-05-06 10:53 ` btrfs-convert on 24Gb image corrupts files Yordan
2024-05-06 13:17   ` Anand Jain
2024-05-06 13:35     ` Yordan
2024-05-06 13:43       ` Anand Jain
2024-05-06 14:57         ` Yordan

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=10bac394-6b9d-4e07-a197-ccd06c16f781@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=jordan.j@mail.bg \
    --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).