[sheepdog] [PATCH] dog/node: remove checking argument in md plug/unplug since root cause is found

Ruoyu liangry at ucweb.com
Thu Aug 7 06:08:23 CEST 2014


The purpose of the checking in the function is to ensure the
argument is not null. But it is not needed any longer because
the argument should be guaranteed in the framework as long as
CMD_NEED_ARG is specified in subcommand.

Since the problem is solved in commit e6d1706, we can remove
the checking safely.

Signed-off-by: Ruoyu <liangry at ucweb.com>
---
 dog/node.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/dog/node.c b/dog/node.c
index b6fd929..f9f7351 100644
--- a/dog/node.c
+++ b/dog/node.c
@@ -441,14 +441,6 @@ static int do_plug_unplug(char *disks, bool plug)
 	struct sd_rsp *rsp = (struct sd_rsp *)&hdr;
 	int ret;
 
-	if (!disks)
-		return EXIT_USAGE;
-
-	if (!strlen(disks)) {
-		sd_err("Empty path isn't allowed");
-		return EXIT_FAILURE;
-	}
-
 	if (plug)
 		sd_init_req(&hdr, SD_OP_MD_PLUG);
 	else
-- 
1.8.3.2




More information about the sheepdog mailing list