All of lore.kernel.org
 help / color / mirror / Atom feed
* Modifying RBD image changes it's snapshot
@ 2013-06-26 12:40 Karol Jurak
  2013-06-26 18:15 ` Josh Durgin
  0 siblings, 1 reply; 4+ messages in thread
From: Karol Jurak @ 2013-06-26 12:40 UTC (permalink / raw)
  To: ceph-devel

Hi,

I'm using ceph 0.56.6 and kernel 3.9.7 and it looks like modifying RBD image 
also changes it's snapshot. I can reproduce this as follows:

# create and map an image
rbd create --size 128 test-1
rbd map test-1

# write some data to the image
dd if=/dev/zero of=/dev/rbd/rbd/test-1 bs=1M count=128

# create and map a snapshot
rbd snap create test-1@snap-1
rbd map test-1@snap-1

# verify that image and snapshot are identical
md5sum /dev/rbd/rbd/test-1 /dev/rbd/rbd/test-1@snap-1 
fde9e0818281836e4fc0edfede2b8762  /dev/rbd/rbd/test-1
fde9e0818281836e4fc0edfede2b8762  /dev/rbd/rbd/test-1@snap-1

# modify the image
dd if=/dev/urandom of=/dev/rbd/rbd/test-1 bs=512 count=1

# compare checksums again
md5sum /dev/rbd/rbd/test-1 /dev/rbd/rbd/test-1@snap-1 
1d942c8a5bc7480cecb945ea0d020eed  /dev/rbd/rbd/test-1
1d942c8a5bc7480cecb945ea0d020eed  /dev/rbd/rbd/test-1@snap-1

Checksums are identical although the snapshot isn't supposed to be modified.

-- 
Karol Jurak

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

* Re: Modifying RBD image changes it's snapshot
  2013-06-26 12:40 Modifying RBD image changes it's snapshot Karol Jurak
@ 2013-06-26 18:15 ` Josh Durgin
  2013-06-26 21:42   ` Josh Durgin
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Durgin @ 2013-06-26 18:15 UTC (permalink / raw)
  To: Karol Jurak; +Cc: ceph-devel

On 06/26/2013 05:40 AM, Karol Jurak wrote:
> Hi,
>
> I'm using ceph 0.56.6 and kernel 3.9.7 and it looks like modifying RBD image
> also changes it's snapshot. I can reproduce this as follows:
>
> # create and map an image
> rbd create --size 128 test-1
> rbd map test-1
>
> # write some data to the image
> dd if=/dev/zero of=/dev/rbd/rbd/test-1 bs=1M count=128
>
> # create and map a snapshot
> rbd snap create test-1@snap-1
> rbd map test-1@snap-1
>
> # verify that image and snapshot are identical
> md5sum /dev/rbd/rbd/test-1 /dev/rbd/rbd/test-1@snap-1
> fde9e0818281836e4fc0edfede2b8762  /dev/rbd/rbd/test-1
> fde9e0818281836e4fc0edfede2b8762  /dev/rbd/rbd/test-1@snap-1
>
> # modify the image
> dd if=/dev/urandom of=/dev/rbd/rbd/test-1 bs=512 count=1
>
> # compare checksums again
> md5sum /dev/rbd/rbd/test-1 /dev/rbd/rbd/test-1@snap-1
> 1d942c8a5bc7480cecb945ea0d020eed  /dev/rbd/rbd/test-1
> 1d942c8a5bc7480cecb945ea0d020eed  /dev/rbd/rbd/test-1@snap-1
>
> Checksums are identical although the snapshot isn't supposed to be modified.
>

Just reproduced on 3.10-rc7 as well. It seems the snapshot context
loading is broken for format 1 a t least, since unmapping and mapping
after the snapshot exists still has the same problem. I added
http://tracker.ceph.com/issues/5464 to track this.

Apparently the regression test for this hasn't been running, or we
would've caught this sooner.

Josh


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

* Re: Modifying RBD image changes it's snapshot
  2013-06-26 18:15 ` Josh Durgin
@ 2013-06-26 21:42   ` Josh Durgin
  2013-06-27 12:13     ` Karol Jurak
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Durgin @ 2013-06-26 21:42 UTC (permalink / raw)
  To: Karol Jurak; +Cc: ceph-devel

On 06/26/2013 11:15 AM, Josh Durgin wrote:
> On 06/26/2013 05:40 AM, Karol Jurak wrote:
>> Hi,
>>
>> I'm using ceph 0.56.6 and kernel 3.9.7 and it looks like modifying RBD
>> image
>> also changes it's snapshot. I can reproduce this as follows:
>>
>> # create and map an image
>> rbd create --size 128 test-1
>> rbd map test-1
>>
>> # write some data to the image
>> dd if=/dev/zero of=/dev/rbd/rbd/test-1 bs=1M count=128
>>
>> # create and map a snapshot
>> rbd snap create test-1@snap-1
>> rbd map test-1@snap-1
>>
>> # verify that image and snapshot are identical
>> md5sum /dev/rbd/rbd/test-1 /dev/rbd/rbd/test-1@snap-1
>> fde9e0818281836e4fc0edfede2b8762  /dev/rbd/rbd/test-1
>> fde9e0818281836e4fc0edfede2b8762  /dev/rbd/rbd/test-1@snap-1
>>
>> # modify the image
>> dd if=/dev/urandom of=/dev/rbd/rbd/test-1 bs=512 count=1
>>
>> # compare checksums again
>> md5sum /dev/rbd/rbd/test-1 /dev/rbd/rbd/test-1@snap-1
>> 1d942c8a5bc7480cecb945ea0d020eed  /dev/rbd/rbd/test-1
>> 1d942c8a5bc7480cecb945ea0d020eed  /dev/rbd/rbd/test-1@snap-1
>>
>> Checksums are identical although the snapshot isn't supposed to be
>> modified.
>>
>
> Just reproduced on 3.10-rc7 as well. It seems the snapshot context
> loading is broken for format 1 a t least, since unmapping and mapping
> after the snapshot exists still has the same problem. I added
> http://tracker.ceph.com/issues/5464 to track this.
>
> Apparently the regression test for this hasn't been running, or we
> would've caught this sooner.

There's a fix for this on the stable kernel in the wip-snapc-3.9.y
branch of ceph-client.git.

Josh


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

* Re: Modifying RBD image changes it's snapshot
  2013-06-26 21:42   ` Josh Durgin
@ 2013-06-27 12:13     ` Karol Jurak
  0 siblings, 0 replies; 4+ messages in thread
From: Karol Jurak @ 2013-06-27 12:13 UTC (permalink / raw)
  To: Josh Durgin; +Cc: ceph-devel

On Wednesday 26 of June 2013 14:42:27 Josh Durgin wrote:
> On 06/26/2013 11:15 AM, Josh Durgin wrote:
> > On 06/26/2013 05:40 AM, Karol Jurak wrote:
> >> Hi,
> >> 
> >> I'm using ceph 0.56.6 and kernel 3.9.7 and it looks like modifying RBD
> >> image
> >> also changes it's snapshot. I can reproduce this as follows:
> > 
> > Just reproduced on 3.10-rc7 as well. It seems the snapshot context
> > loading is broken for format 1 a t least, since unmapping and mapping
> > after the snapshot exists still has the same problem. I added
> > http://tracker.ceph.com/issues/5464 to track this.
> > 
> > Apparently the regression test for this hasn't been running, or we
> > would've caught this sooner.
> 
> There's a fix for this on the stable kernel in the wip-snapc-3.9.y
> branch of ceph-client.git.

Thanks for the fix. Snapshots work as expected now.

-- 
Karol Jurak

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

end of thread, other threads:[~2013-06-27 12:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-26 12:40 Modifying RBD image changes it's snapshot Karol Jurak
2013-06-26 18:15 ` Josh Durgin
2013-06-26 21:42   ` Josh Durgin
2013-06-27 12:13     ` Karol Jurak

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.