On 2016-07-14 23:45, Chris Mason wrote:
>
>
> On 07/12/2016 05:40 PM, Goffredo Baroncelli wrote:
>> Hi All,
>>
>> the enclosed patch adds a new btrfs sub command: "btrfs inspect
>> physical-find". The aim of this new command is to show the physical
>> placement on the disk of a file. Currently it handles all the
>> profiles (single, dup, raid1/10/5/6). I develop this command in
>> order to show some bug in btrfs RAID5 profile (see next email).
>
> I've done this manually from time to time, and love the idea of
> having a helper for it. Can I talk you into adding a way to save the
> contents of the block without having to use dd? btrfs-map-logical
> does this now, but not via the search ioctl and not by filename.
>
> say:
>
> btrfs inspect physical-find -c <copy number> -o <output file> <filename> offset
I prefer to add another command to do that (like btrfs insp physical-dump). And I will add as constraint like
offset % blocksize == 0
this in order to avoid handling data spread different stripes/chunks.
However <copy number> has different meaning:
single/raid0 -> means nothing
raid1/raid10 -> means the copy #
raid5/raid6 -> could mean the parity: i.e.
-1 -> first parity (raid5/raid6)
-2 -> 2nd parity (raid6 only)
> Looks like you've open coded btrfs_map_logical() below, getting
> output from the search ioctl. Dave might want that in a more
> centralized place.
I will give a look
> Also, please turn:
>
> for(;;) if (foo) { statements }
>
> Into
>
> for(;;) { if (foo) { statements } }
>
> I find that much less error prone.
Ok
>
> -chris
>
BR
G.Baroncelli
--
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html