[sheepdog] [PATCH 3/3] sheep: return error when reading snapshot without snapid or tag

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Oct 16 09:32:44 CEST 2012


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/vdi.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 762423a..2177b24 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -346,6 +346,9 @@ static int find_first_vdi(unsigned long start, unsigned long end, char *name,
 		}
 
 		if (!strncmp(inode->name, name, strlen(inode->name))) {
+			if (!(tag && tag[0]) && !snapid && inode->snap_ctime)
+				continue;
+
 			vdi_found = true;
 			if (tag && tag[0] &&
 			    strncmp(inode->tag, tag, sizeof(inode->tag)) != 0)
-- 
1.7.2.5




More information about the sheepdog mailing list