Skip to content

Commit

Permalink
fix online fsck options
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
Kent Overstreet committed Nov 29, 2024
1 parent d4932bf commit 6829fb2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions c_src/cmd_fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6829fb2

Please sign in to comment.