linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsck.f2fs: allow -p without value
@ 2018-01-31  1:26 Jaegeuk Kim
  2018-01-31 10:05 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Jaegeuk Kim @ 2018-01-31  1:26 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Jaegeuk Kim

This patch allows -p without value.

Suggested-by: Pavol Cupka <pavol.cupka@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fsck/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fsck/main.c b/fsck/main.c
index f35d01d..804f71a 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -184,13 +184,13 @@ void f2fs_parse_options(int argc, char *argv[])
 				 *  0: default level, the same as -a
 				 *  1: check meta
 				 */
-				if (optarg[0] == '-') {
+				if (optarg[0] == '-' || !is_digits(optarg) ||
+							optind == argc) {
+					MSG(0, "Info: Use default preen mode\n");
 					c.preen_mode = PREEN_MODE_0;
+					c.auto_fix = 1;
 					optind--;
 					break;
-				} else if (!is_digits(optarg)) {
-					err = EWRONG_OPT;
-					break;
 				}
 				c.preen_mode = atoi(optarg);
 				if (c.preen_mode < 0)
-- 
2.15.0.531.g2ccb3012c9-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fsck.f2fs: allow -p without value
  2018-01-31  1:26 [PATCH] fsck.f2fs: allow -p without value Jaegeuk Kim
@ 2018-01-31 10:05 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2018-01-31 10:05 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-f2fs-devel

On 2018/1/31 9:26, Jaegeuk Kim wrote:
> This patch allows -p without value.
> 
> Suggested-by: Pavol Cupka <pavol.cupka@gmail.com>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-31 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-31  1:26 [PATCH] fsck.f2fs: allow -p without value Jaegeuk Kim
2018-01-31 10:05 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).