linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sidong Yang <realwakka@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: dsterba@suse.cz, linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] btrfs-progs: cmds: Add subcommand that dumps file extents
Date: Fri, 20 Aug 2021 15:23:41 +0000	[thread overview]
Message-ID: <20210820152341.GC17604@realwakka> (raw)
In-Reply-To: <a874228c-3b00-e0d2-9702-2bfcba171fa2@gmx.com>

On Fri, Aug 20, 2021 at 06:16:18AM +0800, Qu Wenruo wrote:
> 
> 
> On 2021/8/19 下午11:27, Sidong Yang wrote:
> > On Thu, Aug 19, 2021 at 02:05:52PM +0800, Qu Wenruo wrote:
> > > 
> > > 
> > > On 2021/8/19 下午2:03, Qu Wenruo wrote:
> > > > 
> > > > 
> > > > On 2021/8/18 上午8:38, Sidong Yang wrote:
> > > > > On Tue, Aug 17, 2021 at 03:30:22PM +0200, David Sterba wrote:
> > > > > > On Sun, Jul 18, 2021 at 06:46:01AM +0000, Sidong Yang wrote:
> > > > > > > This patch adds an subcommand in inspect-internal. It dumps file
> > > > > > > extents of
> > > > > > > the file that user provided. It helps to show the internal information
> > > > > > > about file extents comprise the file.
> > > > > > 
> > > > > > Do you have an example of the output? That's the most interesting part.
> > > > > > Thanks.
> > > > > 
> > > > > Thanks for reply.
> > > > > This is an example of the output below.
> > > > > 
> > > > > # ./btrfs inspect-internal dump-file-extent /mnt/test1
> > > > > type = regular, start = 2097152, len = 3227648, disk_bytenr = 0,
> > > > > disk_num_bytes = 0, offset = 0, compression = none
> > > > > type = regular, start = 5324800, len = 16728064, disk_bytenr = 0,
> > > > > disk_num_bytes = 0, offset = 0, compression = none
> > > > > type = regular, start = 22052864, len = 8486912, disk_bytenr = 0,
> > > > > disk_num_bytes = 0, offset = 0, compression = none
> > > > > type = regular, start = 30572544, len = 36540416, disk_bytenr = 0,
> > > > > disk_num_bytes = 0, offset = 0, compression = none
> > > > > type = regular, start = 67112960, len = 5299630080, disk_bytenr = 0,
> > > > > disk_num_bytes = 0, offset = 0, compression = none
> > > > 
> > > > Could you give an example which includes both real (non-hole) extents
> > > > and real extents (better to include regular, compressed, preallocated
> > > > and inline).
> > > 
> > > Tons of typos... I mean to include both holes (like the existing
> > > example) and non-holes extents...
> > 
> > Sorry, I had no idea about holes. But I found some test code in
> > xfstests. It helpes me to make hole in file.
> > 
> > xfs_io -c "fpunch 96K 32K" /mnt/a/foobar
> > xfs_io -c "fpunch 64K 128K" /mnt/a/foobar
> > 
> > and the example is below.
> > 
> > # ./btrfs inspect dump-file-extent /mnt/a/foobar
> > type = regular, start = 0, len = 98304, disk_bytenr = 21651456,
> > disk_num_bytes = 4096, offset = 0, compression = zstd
> > type = regular, start = 98304, len = 32768, disk_bytenr = 0,
> > disk_num_bytes = 0, offset = 0, compression = none
> > 
> > I'm afaid that I understand your request correctly. Is it what you want?
> 
> This example is much better.
> 
> But still, for holes, things like
> disk_bytenr/disk_num_bytes/offset/compression makes no sense and can be
> skipped.

Okay. If disk_bytenr is zero, other information after this would be
skipped in next version.
> 
> Furthermore, for hole/prealloc they need extra type other than "regular"

For now, It already has prealloc type. but no hole type. All the types
are inline/prealloc/regular/hole? If so, disk_bytenr should be checked
before print it's type.

Thanks,
Sidong
> 
> Thanks,
> Qu
> > > 
> > > > 
> > > > Currently the output only contains holes, and for holes, a lot of
> > > > members makes no sense, like disk_bytenr/disk_num_bytes/offset (even it
> > > > can be non-zero) and compression.
> > > > 
> > > > Thanks,
> > > > Qu
> > > > 
> > > > > 
> > > > > Thanks,
> > > > > Sidong
> > > > > 

      reply	other threads:[~2021-08-20 15:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18  6:45 [PATCH v4 0/2] Add subcommand that dumps file extents Sidong Yang
2021-07-18  6:46 ` [PATCH v4 1/2] btrfs-progs: export util functions about file extent items Sidong Yang
2021-07-18  6:46 ` [PATCH v4 2/2] btrfs-progs: cmds: Add subcommand that dumps file extents Sidong Yang
2021-08-17 13:30   ` David Sterba
2021-08-18  0:38     ` Sidong Yang
2021-08-18 16:59       ` David Sterba
2021-08-19  3:44         ` Sidong Yang
2021-08-19  6:03       ` Qu Wenruo
2021-08-19  6:05         ` Qu Wenruo
2021-08-19 15:27           ` Sidong Yang
2021-08-19 22:16             ` Qu Wenruo
2021-08-20 15:23               ` Sidong Yang [this message]

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=20210820152341.GC17604@realwakka \
    --to=realwakka@gmail.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    /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).