bcachefs: BCH_IOCTL_FSCK_ONLINE
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 4 Dec 2023 18:45:33 +0000 (13:45 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:40 +0000 (11:47 -0500)
commit267b801fda10b70eca4001a819fcac07f023df6b
tree41d9bfd3452ecd85ab133d82e753c4e3f4c0a43e
parent8408fa570ef9b8c35720369bad6b13828ae6b001
bcachefs: BCH_IOCTL_FSCK_ONLINE

This adds a new ioctl for running fsck on a mounted, in use filesystem.

This reuses the fsck_thread code from the previous patch for running
fsck on an offline, unmounted filesystem, so that log messages for the
fsck thread are redirected to userspace.

Only one running fsck instance is allowed at a time; a new semaphore
(since the lock will be taken by one thread and released by another) is
added for this.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/bcachefs_ioctl.h
fs/bcachefs/chardev.c
fs/bcachefs/super.c