CEPH filesystem development
 help / color / mirror / Atom feed
* [PATCH] rbd: ignore unmapped snapshots that no longer exist
@ 2013-08-30  2:19 Josh Durgin
  2013-09-03 13:29 ` Alex Elder
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Durgin @ 2013-08-30  2:19 UTC (permalink / raw)
  To: ceph-devel

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>
---
 drivers/block/rbd.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 0e83a10..545ceff 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4077,8 +4077,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);
 	}
-- 
1.7.2.5


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

end of thread, other threads:[~2013-09-09  7:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30  2:19 [PATCH] rbd: ignore unmapped snapshots that no longer exist Josh Durgin
2013-09-03 13:29 ` Alex Elder
2013-09-09  7:31   ` Josh Durgin
2013-09-09  7:32     ` Josh Durgin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox