[sheepdog] [PATCH v3 3/7] dog: use GET_VDI_INFO unconditionally in dog

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Thu Jul 31 04:51:24 CEST 2014


dog command needs to read/write inode objects for various operations
e.g. taking snapshot. The operations shouldn't be prevented by locks
acquired by other clients (QEMU and tgt). SD_OP_GET_VDI_INFO doesn't
try to acquire the lock, so dog command should use it unconditionally.

Cc: Fabian Zimmermann <dev.faz at gmail.com>
Cc: Valerio Pachera <sirio81 at gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 dog/vdi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/dog/vdi.c b/dog/vdi.c
index 2e3f7b3..739a0af 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -346,10 +346,7 @@ static int find_vdi_name(const char *vdiname, uint32_t snapid, const char *tag,
 	if (tag)
 		pstrcpy(buf + SD_MAX_VDI_LEN, SD_MAX_VDI_TAG_LEN, tag);
 
-	if (for_snapshot)
-		sd_init_req(&hdr, SD_OP_GET_VDI_INFO);
-	else
-		sd_init_req(&hdr, SD_OP_LOCK_VDI);
+	sd_init_req(&hdr, SD_OP_GET_VDI_INFO);
 	hdr.data_length = SD_MAX_VDI_LEN + SD_MAX_VDI_TAG_LEN;
 	hdr.flags = SD_FLAG_CMD_WRITE;
 	hdr.vdi.snapid = snapid;
-- 
1.8.3.2




More information about the sheepdog mailing list