Bug 201751 - lvcreate doesn't lockfs the origin filesystem when creating the first snapshot
lvcreate doesn't lockfs the origin filesystem when creating the first snapshot
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-08 14:20 EDT by Jan Blunck
Modified: 2008-05-01 11:39 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-19 16:11:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Blunck 2006-08-08 14:20:03 EDT
Description of problem:
lvcreate doesn't lockfs the origin filesystem when creating the first snapshot.
This leads to unusable snapshots because the filesystem isn't synced before
creating the snapshot.

Version-Release number of selected component (if applicable):
2.02.08

How reproducible:
easily

Steps to Reproduce:
1. Create LV test on VG test with ext3 filesystem
2. lvcreate -s -L 320M -n snap1 -p r test/test
3. mount -r /dev/test/snap1 /mnt
  
Actual results:
s390vm01:~ # mount -r /dev/test/snap1 /tmp/m1
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access unavailable, cannot proceed. 
mount: wrong fs type, bad option, bad superblock on /dev/test/snap1,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Expected results:


Additional info:
The problem is in lib/activate/dev_manager.c:
                if (!lv_is_origin(lv) && !lv_is_cow(lv))
                        dm_tree_skip_lockfs(root);

When creating the first snapshot of a LV lv_is_origin() is still false because
we suspend the LV before creating the snapshot. Therefore the original LV is
suspended without lockfs.
Comment 1 Alasdair Kergon 2006-08-08 17:21:54 EDT
Proposed fix:
  http://sources.redhat.com/ml/lvm2-cvs/2006-08/msg00001.html

Test set should include every command that does a suspend:

lvchange -ay (of all object types), lvcreate first snapshot, lvcreate second
snapshot of same device, lvremove second snapshot, lvchange --refresh, pvmove,
vgreduce --removemissing, lvresize, lvrename, lvconvert
Comment 2 Fedora Update System 2007-01-10 15:27:47 EST
lvm2-2.02.17-1.fc6 has been pushed for fc6, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 3 Fedora Update System 2007-01-22 12:02:23 EST
lvm2-2.02.17-1.fc6 has been pushed for fc6, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 4 Corey Marthaler 2007-01-24 15:35:05 EST
Verified fixed in lvm2-2.02.19-1.el4.

[root@link-08 ~]# lvs
  LV     VG   Attr   LSize   Origin Snap%  Move Log Copy%
  origin vg   owi-a- 600.00M
  snap1  vg   sri-a- 320.00M origin   0.00

[root@link-08 ~]# mount -r /dev/vg/snap1 /mnt/snap

Jan 24 09:48:54 link-08 kernel: kjournald starting.  Commit interval 5 seconds
Jan 24 09:48:54 link-08 kernel: EXT3-fs: mounted filesystem with ordered data mode.

I also ran some of the other commands mentioned in comment #1

Note You need to log in before you can comment on or make changes to this bug.