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

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Jun 27 08:13:54 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.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 dog/vdi.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/dog/vdi.c b/dog/vdi.c
index 49a2139..07d653a 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -316,10 +316,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.7.1




More information about the sheepdog mailing list