To keep line with e2fsprogs, let's allow to fsck mounted image as
readonly w/ -f option.
Reported-by: Perfect Gentleman <perfect007gentleman@gmail.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
case 'f':
case 'y':
c.fix_on = 1;
+ c.force = 1;
MSG(0, "Info: Force to fix corruption\n");
break;
case 'q':
void *private;
int dry_run;
int fix_on;
+ int force;
int defset;
int bug_on;
int alloc_failed;
return -1;
}
- if (S_ISBLK(stat_buf->st_mode))
+ if (S_ISBLK(stat_buf->st_mode) && !c.force)
fd = open(dev->path, O_RDWR | O_EXCL);
else
fd = open(dev->path, O_RDWR);