mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-09 00:00:17 +03:00
cmd_fsck: make sure to modprobe if we might need kernel fsck
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
838bbd755e
commit
0a7bbc6aeb
@ -115,8 +115,6 @@ static void append_opt(struct printbuf *out, const char *opt)
|
||||
|
||||
static bool should_use_kernel_fsck(darray_const_str devs)
|
||||
{
|
||||
system("modprobe bcachefs");
|
||||
|
||||
unsigned kernel_version = bcachefs_kernel_version();
|
||||
|
||||
if (!kernel_version)
|
||||
@ -273,6 +271,9 @@ int cmd_fsck(int argc, char *argv[])
|
||||
return fsck_online(*i, opts_str.buf);
|
||||
}
|
||||
|
||||
if (kernel)
|
||||
system("modprobe bcachefs");
|
||||
|
||||
int kernel_probed = kernel;
|
||||
if (kernel_probed < 0)
|
||||
kernel_probed = should_use_kernel_fsck(devs);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user