All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] btrfs-progs: coalesce of patches
@ 2013-06-10 14:56 Anand Jain
  2013-06-10 14:56 ` [PATCH 1/9] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments Anand Jain
                   ` (13 more replies)
  0 siblings, 14 replies; 56+ messages in thread
From: Anand Jain @ 2013-06-10 14:56 UTC (permalink / raw)
  To: linux-btrfs

A patch set revised/rebased on integration-20130524
these were posted before but havn't made into the repo yet.

I.
Introduce btrfs filesystem show --kernel

There are bugs surrounding btrfs filesystem show,
when ran immediately after the oprations like
btrfs fi label <mnt> <label> and btrfs dev delete <mnt>
the btrfs fi show will still show the contents which is
staled by the preceding label and device operation as show
below

btrfs fi show fails to report label immediately after label

----
btrfs fi label /btrfs test10

btrfs fi show
Label: 'test'  uuid: 22b6f318-07d4-4af4-b8e5-b2682cb83a7a
        Total devices 3 FS bytes used 28.00KB
        devid    3 size 15.00GB used 0.00 path /dev/dm-6
        devid    4 size 44.99GB used 1.03GB path /dev/dm-4

btrfs fi label /btrfs
test10

btrfs fi show --kernel
Label: 'test10'  uuid: 22b6f318-07d4-4af4-b8e5-b2682cb83a7a
        Total devices 2 FS bytes used 28.00KB
        devid    3 size 15.00GB used 0.00 path /dev/dm-6
        devid    4 size 44.99GB used 1.03GB path /dev/dm-4
-----

After dropping the cache its fine, but to expect the user
to drop the caches to get a consistent view is not a good idea..

-----
btrfs fi show
Label: 'test3'  uuid: 0a621111-ad84-4d80-842a-dd9c1c60bf51
    Total devices 2 FS bytes used 200.41MB
    devid    2 size 48.23GB used 2.03GB path /dev/dm-5
    devid    1 size 44.99GB used 2.04GB path /dev/dm-4

btrfs fi label /btrfs
test5

echo 3 > /proc/sys/vm/drop_caches
btrfs fi show
Label: 'test5'  uuid: 0a621111-ad84-4d80-842a-dd9c1c60bf51
    Total devices 2 FS bytes used 200.41MB
    devid    2 size 48.23GB used 2.03GB path /dev/dm-5
    devid    1 size 44.99GB used 2.04GB path /dev/dm-4
-----

bugs with btrfs fi show and btrfs device operation..
----
btrfs fi show
Label: 'test'  uuid: 22b6f318-07d4-4af4-b8e5-b2682cb83a7a
        Total devices 3 FS bytes used 28.00KB
        devid    3 size 15.00GB used 0.00 path /dev/dm-6
        devid    4 size 44.99GB used 0.00 path /dev/dm-4
        devid    2 size 48.23GB used 1.03GB path /dev/dm-5

btrfs dev del /dev/dm-5 /btrfs

(dm-5 is replaced with sde, the previous patch use mapper
will fix this, But reports missing since SB is not yet
updated on the disk) 
btrfs fi show
Label: 'test'  uuid: 22b6f318-07d4-4af4-b8e5-b2682cb83a7a
        Total devices 3 FS bytes used 28.00KB
        devid    3 size 15.00GB used 0.00 path /dev/dm-6
        devid    4 size 44.99GB used 1.03GB path /dev/dm-4
        devid    2 size 48.23GB used 1.03GB path /dev/sde


btrfs fi show --mapper
Label: 'test'  uuid: 22b6f318-07d4-4af4-b8e5-b2682cb83a7a
        Total devices 3 FS bytes used 28.00KB
        devid    4 size 44.99GB used 1.03GB path /dev/mapper/mpathe
        devid    3 size 15.00GB used 0.00 path /dev/mapper/mpathbp1
        *** Some devices missing

The newly introduced --kernel option is in line with the
device operation...

btrfs fi show --kernel
Label: 'test'  uuid: 22b6f318-07d4-4af4-b8e5-b2682cb83a7a
        Total devices 2 FS bytes used 28.00KB
        devid    3 size 15.00GB used 0.00 path /dev/dm-6
        devid    4 size 44.99GB used 1.03GB path /dev/dm-4
--------

In long run, I hope to make the --kernel a default option
for the mounted fs and scan devpath to look for non-mounted
btrfs.

II.
  btrfs-progs: device delete to get errors from the kernel
  v3: rebased with other patches here.

III. (patch 1/8 to 5/8)
The idea was to introduce /dev/mapper to find for btrfs disk, 
However I found first we need to congregate the disk scan
procedure at a function so it would help to consistently tune
it across the btrfs-progs. As of now both fi show and
dev scan use the disks scan they do it on their own.

So here it would congregate btrfs-disk scans at the function
scan_devs_for_btrfs, adds /dev/mapper to be used to scan
for btrfs, and updates its calling functions and few bug fixes.

v1->v2:
 Rebased on top of David' integration branch origin/integration-20130524

 patch 1 to 5 (below) are made independent of the idea to have the
 /dev/mapper as one of the path to recognize the btrfs disks.
 Which means they can be installed with out having anything
 new. It just adds the framework/improves to integrated a
 /dev/mapper path, which is only done in the patch 6.
 So patch 1 to 5 are safe.
 Also in v1 I suggested that we have -d option instead of
 long option --all-devices which I have dropped that idea
 here in v2.

 Patch 6: adds a new option --mapper to the filesystem show
 and device scan which inturn will use /dev/mapper to scan
 for the btrfs.

 Example output of using the --mapper option is as below..

btrfs filesystem show --mapper
Label: none  uuid: 0a621111-ad84-4d80-842a-dd9c1c60bf51
	Total devices 2 FS bytes used 1.17MB
	devid    1 size 44.99GB used 2.04GB path /dev/mapper/mpathe
	devid    2 size 48.23GB used 2.03GB path /dev/mapper/mpathd

Label: none  uuid: bad9105f-bdc6-4626-9ba7-80bd97aebe19
	Total devices 1 FS bytes used 28.00KB
	devid    1 size 15.00GB used 2.04GB path /dev/mapper/mpathbp1

Btrfs v0.20-rc1-350-g7731651

btrfs device scan --mapper
-----
[1118885.473298] device fsid bad9105f-bdc6-4626-9ba7-80bd97aebe19 devid 1 transid 4 /dev/mapper/mpathbp1
[1118885.474077] device fsid 0a621111-ad84-4d80-842a-dd9c1c60bf51 devid 2 transid 103 /dev/mapper/mpathd
[1118885.474133] device fsid 0a621111-ad84-4d80-842a-dd9c1c60bf51 devid 1 transid 103 /dev/mapper/mpathe
-----

Anand Jain (9):
  btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments
  btrfs-progs: label option in btrfs filesystem show is not coded
  btrfs-progs: update device scan usage
  btrfs-progs: congregate dev scan
  btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is
    provided
  btrfs-progs: scan /dev/mapper in filesystem show and device scan
  btrfs-progs: device delete to get errors from the kernel
  btrfs-progs: get_label_mounted to return label instead of print
  btrfs-progs: introduce btrfs filesystem show --kernel

 btrfs-find-root.c |   2 +-
 cmds-device.c     |  29 ++++--
 cmds-filesystem.c |  21 ++--
 ctree.h           |   1 -
 disk-io.c         |   2 +-
 ioctl.h           | 107 ++++++++++++++++++-
 man/btrfs.8.in    |  16 +--
 utils.c           | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 utils.h           |  13 ++-
 volumes.c         |  20 +++-
 volumes.h         |   3 +
 11 files changed, 467 insertions(+), 47 deletions(-)

-- 
1.8.1.227.g44fe835

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2013-08-13  4:07 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 14:56 [PATCH 0/9] btrfs-progs: coalesce of patches Anand Jain
2013-06-10 14:56 ` [PATCH 1/9] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments Anand Jain
2013-06-10 20:00   ` Eric Sandeen
2013-06-11 13:15     ` anand jain
2013-06-10 14:56 ` [PATCH 2/9 v2] btrfs-progs: label option in btrfs filesystem show is not coded Anand Jain
2013-06-10 14:56 ` [PATCH 3/9 v2] btrfs-progs: update device scan usage Anand Jain
2013-06-10 14:56 ` [PATCH 4/9 v3] btrfs-progs: congregate dev scan Anand Jain
2013-06-10 14:56 ` [PATCH 5/9 v2] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided Anand Jain
2013-06-10 14:56 ` [PATCH 6/9 v2] btrfs-progs: scan /dev/mapper in filesystem show and device scan Anand Jain
2013-06-10 14:56 ` [PATCH 7/9 v3] btrfs-progs: device delete to get errors from the kernel Anand Jain
2013-06-10 14:56 ` [PATCH 8/9] btrfs-progs: get_label_mounted to return label instead of print Anand Jain
2013-06-21  7:41   ` [PATCH 08/13 v2] " Anand Jain
2013-06-10 14:56 ` [PATCH 9/9 v2] btrfs-progs: introduce btrfs filesystem show --kernel Anand Jain
2013-06-10 14:59 ` [PATCH 0/2] btrfs: coalesce of patches Anand Jain
2013-06-10 14:59   ` [PATCH 1/2] btrfs: device delete to get errors from the kernel Anand Jain
2013-06-10 14:59   ` [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info " Anand Jain
2013-06-10 19:40     ` Josef Bacik
2013-06-11 13:10       ` anand jain
2013-06-11 13:15         ` Josef Bacik
2013-06-10 20:30     ` Zach Brown
2013-06-11 14:05       ` anand jain
2013-06-11 17:50         ` Zach Brown
2013-06-11 14:24     ` Josef Bacik
2013-06-21  7:02       ` Anand Jain
2013-06-21  7:32     ` [PATCH 2/2 v3] btrfs: obtain used_bytes in BTRFS_IOC_FS_INFO ioctl Anand Jain
2013-06-24 17:03       ` Josef Bacik
2013-06-25  3:00         ` Anand Jain
2013-07-08  7:39 ` [PATCH 13/13] btrfs-progs: fix memory leaks of device_list_add() Anand Jain
2013-07-15  4:58   ` Anand Jain
2013-07-15  5:30 ` [PATCH 00/11 v2 (resend)] btrfs-progs: coalesce of patches Anand Jain
2013-07-15  5:30   ` [PATCH 01/11] btrfs-progs: btrfs_scan_for_fsid doesn't need all the arguments Anand Jain
2013-07-15  5:30   ` [PATCH 02/11] btrfs-progs: label option in btrfs filesystem show is not coded Anand Jain
2013-07-15  5:30   ` [PATCH 03/11] btrfs-progs: update device scan usage Anand Jain
2013-07-15  5:30   ` [PATCH 04/11] btrfs-progs: congregate dev scan Anand Jain
2013-07-15  5:30   ` [PATCH 05/11] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided Anand Jain
2013-08-05 16:53     ` David Sterba
2013-07-15  5:30   ` [PATCH 06/11] btrfs-progs: scan /dev/mapper in filesystem show and device scan Anand Jain
2013-08-05 17:04     ` David Sterba
2013-08-13  4:07       ` anand jain
2013-07-15  5:30   ` [PATCH 07/11] btrfs-progs: device delete to get errors from the kernel Anand Jain
2013-07-15  5:30   ` [PATCH 08/11] btrfs-progs: get_label_mounted to return label instead of print Anand Jain
2013-07-15  5:30   ` [PATCH 09/11] btrfs-progs: move out print in cmd_df to another function Anand Jain
2013-07-15  5:30   ` [PATCH 10/11] btrfs-progs: get string for the group profile and type Anand Jain
2013-07-15  5:30   ` [PATCH 11/11] btrfs-progs: introduce btrfs filesystem show --kernel Anand Jain
2013-08-05 17:36   ` [PATCH 00/11 v2 (resend)] btrfs-progs: coalesce of patches David Sterba
2013-08-06 15:08     ` anand jain
2013-08-08  8:07 ` [PATCH 0/2 v2] introduce btrfs filesystem show --kernel Anand Jain
2013-08-08  8:07   ` [PATCH 1/2] btrfs-progs: move out print in cmd_df to another function Anand Jain
2013-08-08  8:07   ` [PATCH 2/2] btrfs-progs: introduce btrfs filesystem show --kernel Anand Jain
2013-08-08 18:08     ` Zach Brown
2013-08-09 10:57       ` anand jain
2013-08-09 18:03         ` Zach Brown
2013-08-08  8:09 ` [PATCH 0/2] scan /dev/mapper in filesystem show and device scan Anand Jain
2013-08-08  8:09   ` [PATCH 1/2] btrfs-progs: btrfs_scan_one_dir not to skip links when /dev/mapper is provided Anand Jain
2013-08-08  8:09   ` [PATCH 2/2] btrfs-progs: scan /dev/mapper in filesystem show and device scan Anand Jain
2013-08-08  8:10   ` [PATCH 0/2] " anand jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.