fix online fsck options

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-11-28 23:43:06 -05:00
parent d4932bf0e3
commit 6829fb2010

View File

@ -90,12 +90,14 @@ static int splice_fd_to_stdinout(int fd)
return close(fd);
}
static int fsck_online(const char *dev_path)
static int fsck_online(const char *dev_path, const char *opt_str)
{
int dev_idx;
struct bchfs_handle fs = bchu_fs_open_by_dev(dev_path, &dev_idx);
struct bch_ioctl_fsck_online fsck = { 0 };
struct bch_ioctl_fsck_online fsck = {
.opts = (unsigned long) opt_str
};
int fsck_fd = ioctl(fs.ioctl_fd, BCH_IOCTL_FSCK_ONLINE, &fsck);
if (fsck_fd < 0)
@ -271,7 +273,7 @@ int cmd_fsck(int argc, char *argv[])
darray_for_each(devs, i)
if (dev_mounted(*i)) {
printf("Running fsck online\n");
return fsck_online(*i);
return fsck_online(*i, opts_str.buf);
}
int kernel_probed = kernel;