mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
snapshot: check snapshot exists
Return 0 if the LV is not even snapshot.
This commit is contained in:
parent
435c82f8f6
commit
c46d4a745d
@ -141,8 +141,9 @@ int lv_is_merging_origin(const struct logical_volume *origin)
|
||||
|
||||
int lv_is_merging_cow(const struct logical_volume *snapshot)
|
||||
{
|
||||
struct lv_segment *snap_seg = find_snapshot(snapshot);
|
||||
/* checks lv_segment's status to see if cow is merging */
|
||||
return (find_snapshot(snapshot)->status & MERGING) ? 1 : 0;
|
||||
return (snap_seg && (snap_seg->status & MERGING)) ? 1 : 0;
|
||||
}
|
||||
|
||||
struct lv_segment *find_snapshot(const struct logical_volume *lv)
|
||||
|
Loading…
x
Reference in New Issue
Block a user