All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2][BTRFS-PROGS] Don't use LVM snapshot device
@ 2014-12-04 18:39 Goffredo Baroncelli
  2014-12-04 18:39 ` [PATCH 1/5] Avoid to consider lvm snapshots when scanning devices Goffredo Baroncelli
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Goffredo Baroncelli @ 2014-12-04 18:39 UTC (permalink / raw)
  To: linux-btrfs


LVM snapshots are a problem for the btrfs devices management.
BTRFS assumes that each device have an unique 'device UUID'. 
A LVM snapshot breaks this assumption.

This causes a lot of problems if some btrfs device are snapshotted:
- the set of devices for a btrfs multi-volume filesystem may be mixed
(i.e. some NON snapshotted device with some snapshotted devices)
- /proc/mount may returns a wrong device. 

In the mailing list some posts reported these incidents.

This patch allows btrfs to skip LVM snapshot during the device scan 
phase.

But if you need to consider a LVM snapshot you can set the
environment variable BTRFS_SKIP_LVM_SNAPSHOT to "no". In this case
the old behavior is applied.

To check if a device is a LVM snapshot, it is checked the 'udev'
device property 'DM_UDEV_LOW_PRIORITY_FLAG' . If it is set to 1,
the device has to be skipped.

As consequence, btrfs now depends also by the libudev.

The last patch is a check to ensure that the devices list 
doesn't contain two devices with the same dev.uuid. This check is 
performed *ONLY* when btrfs collects the information about all devices (
i.e. btrfs device scan <device> is not this case).

This patch addresses the following cases:
- scanning performed by udev rules
- "btrfs device scan" performed in the initramdisk
- btrfs device scan <device>
- other programs which call btrfs_scan_lblkid()

BR
G.Baroncelli

-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

Changelog
V2: moved some chunk from patch#5 to patch#2
V1: first issue

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH][BTRFS-PROGS] Skip LVM snapshot device
@ 2014-12-04 18:24 Goffredo Baroncelli
  2014-12-04 18:24 ` [PATCH 1/5] Avoid to consider lvm snapshots when scanning devices Goffredo Baroncelli
  0 siblings, 1 reply; 20+ messages in thread
From: Goffredo Baroncelli @ 2014-12-04 18:24 UTC (permalink / raw)
  To: linux-btrfs



LVM snapshots are a problem for the btrfs devices management.
BTRFS assumes that each device have an unique 'device UUID'. 
A LVM snapshot breaks this assumption.

This causes a lot of problems if some btrfs device are snapshotted:
- the set of devices for a btrfs multi-volume filesystem may be mixed
(i.e. some NON snapshotted device with some snapshotted devices)
- /proc/mount may returns a wrong device. 

In the mailing list some posts reported these incidents.

This patch allows btrfs to skip LVM snapshot during the device scan 
phase.

But if you need to consider a LVM snapshot you can set the
environment variable BTRFS_SKIP_LVM_SNAPSHOT to "no". In this case
the old behavior is applied.

To check if a device is a LVM snapshot, it is checked the 'udev'
device property 'DM_UDEV_LOW_PRIORITY_FLAG' . If it is set to 1,
the device has to be skipped.

As consequence, btrfs now depends also by the libudev.

The last patch is a check to ensure that the devices list 
doesn't contain two devices with the same dev.uuid. This check is 
performed *ONLY* when btrfs collects the information about all devices (
i.e. btrfs device scan <device> is not this case).

This patch addresses the following cases:
- scanning performed by udev rules
- "btrfs device scan" performed in the initramdisk
- btrfs device scan <device>
- other programs which call btrfs_scan_lblkid()

BR
G.Baroncelli


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

end of thread, other threads:[~2014-12-10 18:38 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04 18:39 [PATCH V2][BTRFS-PROGS] Don't use LVM snapshot device Goffredo Baroncelli
2014-12-04 18:39 ` [PATCH 1/5] Avoid to consider lvm snapshots when scanning devices Goffredo Baroncelli
2014-12-08  2:02   ` Qu Wenruo
2014-12-08 14:58     ` Goffredo Baroncelli
2014-12-09  0:32       ` Qu Wenruo
2014-12-09 10:27       ` David Sterba
2014-12-09 18:19         ` Goffredo Baroncelli
2014-12-04 18:39 ` [PATCH 2/5] 'btrfs device scan' skips lvm snapshots Goffredo Baroncelli
2014-12-04 18:39 ` [PATCH 3/5] Update 'btrfs device scan' man page Goffredo Baroncelli
2014-12-04 18:39 ` [PATCH 4/5] Add reference to BTRFS_SKIP_LVM_SNAPSHOT environment variable Goffredo Baroncelli
2014-12-04 18:39 ` [PATCH 5/5] Abort in case of device uuid conflict Goffredo Baroncelli
2014-12-05  7:26 ` [PATCH V2][BTRFS-PROGS] Don't use LVM snapshot device Duncan
2014-12-05 18:39   ` Goffredo Baroncelli
2014-12-08 15:30 ` Phillip Susi
2014-12-08 17:36   ` Goffredo Baroncelli
2014-12-08 18:17     ` Phillip Susi
2014-12-08 19:22     ` Robert White
2014-12-10  7:52 ` Anand Jain
2014-12-10 18:40   ` Goffredo Baroncelli
  -- strict thread matches above, loose matches on Subject: below --
2014-12-04 18:24 [PATCH][BTRFS-PROGS] Skip " Goffredo Baroncelli
2014-12-04 18:24 ` [PATCH 1/5] Avoid to consider lvm snapshots when scanning devices Goffredo Baroncelli

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.