mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git
synced 2024-11-27 11:43:36 +08:00
f2fs_io: exit if system(3) is failed
Exit the request, if system(3) is failed to be executed. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
fec5a029b1
commit
e87d54e90d
@ -374,19 +374,23 @@ static void do_gc_urgent(int argc, char **argv, const struct cmd_desc *cmd)
|
||||
if (argc == 3 && !strcmp(argv[2], "start")) {
|
||||
printf("gc_urgent: start on %s\n", argv[1]);
|
||||
sprintf(command, "echo %d > %s/%s/gc_urgent", 1, "/sys/fs/f2fs/", argv[1]);
|
||||
system(command);
|
||||
if (system(command))
|
||||
exit(1);
|
||||
} else if (argc == 3 && !strcmp(argv[2], "end")) {
|
||||
printf("gc_urgent: end on %s\n", argv[1]);
|
||||
sprintf(command, "echo %d > %s/%s/gc_urgent", 0, "/sys/fs/f2fs/", argv[1]);
|
||||
system(command);
|
||||
if (system(command))
|
||||
exit(1);
|
||||
} else if (argc == 4 && !strcmp(argv[2], "run")) {
|
||||
printf("gc_urgent: start on %s for %d secs\n", argv[1], atoi(argv[3]));
|
||||
sprintf(command, "echo %d > %s/%s/gc_urgent", 1, "/sys/fs/f2fs/", argv[1]);
|
||||
system(command);
|
||||
if (system(command))
|
||||
exit(1);
|
||||
sleep(atoi(argv[3]));
|
||||
printf("gc_urgent: end on %s for %d secs\n", argv[1], atoi(argv[3]));
|
||||
sprintf(command, "echo %d > %s/%s/gc_urgent", 0, "/sys/fs/f2fs/", argv[1]);
|
||||
system(command);
|
||||
if (system(command))
|
||||
exit(1);
|
||||
} else {
|
||||
fputs("Excess arguments\n\n", stderr);
|
||||
fputs(cmd->cmd_help, stderr);
|
||||
|
Loading…
Reference in New Issue
Block a user