]> Pileus Git - ~andy/linux/commit
rbd: clear EXISTS flag if mapped snapshot disappears
authorAlex Elder <elder@inktank.com>
Wed, 1 May 2013 17:43:03 +0000 (12:43 -0500)
committerAlex Elder <elder@inktank.com>
Thu, 2 May 2013 16:57:03 +0000 (11:57 -0500)
commit15228ede7d9437b0dcfe9331c9830b3646fdadf7
treec7cde40606269d18896dd3a307b8cdf10e5f92df
parent33dca39f5c0c750d37d3d89ce8ae66be08280a45
rbd: clear EXISTS flag if mapped snapshot disappears

This functionality inadvertently disappeared in the last patch.

Image snapshots can get removed at just about any time.  In
particular it can disappear even if it is in use by an rbd
client as a mapped image.

The rbd client deals with such a disappearance by responding to new
requests with ENXIO.  This is implemented by each rbd device
maintaining an EXISTS flag, which is normally set but cleared if a
snapshot disappears.

This patch (re-)implements the clearing of that flag.

Whenever mapped image header information is refreshed, if the
mapping is for a snapshot, verify the mapped snapshot is still
present in the updated snapshot context.  If it is not, clear the
flag.

It is not necessary to check this in the initial probe, because the
probe will not succeed if the snapshot doesn't exist.

This resolves:
    http://tracker.ceph.com/issues/4880

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c