summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@inktank.com>2013-08-29 19:16:42 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-09 12:24:26 -0800
commit6fe77759c31c0f5fc36837549c5848470113509b (patch)
treec4dc676e2766974df7913c39c9e3069400e5910c /drivers/block
parent5b213542db631f8b0bf7b257e8ae2d37b134895c (diff)
downloadlinux-3.10-6fe77759c31c0f5fc36837549c5848470113509b.tar.gz
linux-3.10-6fe77759c31c0f5fc36837549c5848470113509b.tar.bz2
linux-3.10-6fe77759c31c0f5fc36837549c5848470113509b.zip
rbd: ignore unmapped snapshots that no longer exist
commit efadc98aab674153709cc357ba565f04e3164fcd upstream. This prevents erroring out while adding a device when a snapshot unrelated to the current mapping is deleted between reading the snapshot context and reading the snapshot names. If the mapped snapshot name is not found an error still occurs as usual. Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 58a4e03b731..e917d4f7b76 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4055,8 +4055,13 @@ static u64 rbd_v2_snap_id_by_name(struct rbd_device *rbd_dev, const char *name)
snap_id = snapc->snaps[which];
snap_name = rbd_dev_v2_snap_name(rbd_dev, snap_id);
- if (IS_ERR(snap_name))
- break;
+ if (IS_ERR(snap_name)) {
+ /* ignore no-longer existing snapshots */
+ if (PTR_ERR(snap_name) == -ENOENT)
+ continue;
+ else
+ break;
+ }
found = !strcmp(name, snap_name);
kfree(snap_name);
}