[sheepdog] [PATCH] dog: don't set copy_policy for inode update of 'vdi write/create'

Liu Yuan namei.unix at gmail.com
Wed Oct 9 12:51:27 CEST 2013


inode object isn't erasure coded but replicated.

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 dog/vdi.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dog/vdi.c b/dog/vdi.c
index db32193..b4a2aeb 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -559,8 +559,7 @@ static int vdi_create(int argc, char **argv)
 		inode->data_vdi_id[idx] = vid;
 		ret = sd_write_object(vid_to_vdi_oid(vid), 0, &vid, sizeof(vid),
 				      SD_INODE_HEADER_SIZE + sizeof(vid) * idx,
-				      0, inode->nr_copies, inode->copy_policy,
-				      false, true);
+				      0, inode->nr_copies, 0, false, true);
 		if (ret) {
 			ret = EXIT_FAILURE;
 			goto out;
@@ -1323,11 +1322,12 @@ static int vdi_write(int argc, char **argv)
 		}
 
 		if (create) {
+			/* For inode update, don't set copy_policy */
 			ret = sd_write_object(vid_to_vdi_oid(vid), 0, &vid,
 					      sizeof(vid),
 				SD_INODE_HEADER_SIZE + sizeof(vid) * idx,
 					      flags, inode->nr_copies,
-					      inode->copy_policy, false, false);
+					      0, false, false);
 			if (ret) {
 				ret = EXIT_FAILURE;
 				goto out;
-- 
1.7.9.5




More information about the sheepdog mailing list