News: 0001564818

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Linux 6.17 Will Let Multi-Device Filesystems Better Cope With Losing A Disk

([Linux Storage] 4 Hours Ago Native RAID Lost Disk)


The VFS changes were merged a short time ago to the in-development Linux 6.17 kernel. Among the notable changes there is a patch that will allow file-systems like Btrfs and Bcachefs to better handle losing a disk in their built-in RAID/multi-device capabilities.

A new method is being introduced in Linux 6.17 to allow multi-device file-systems like Btrfs with its native/built-in RAID capabilities to be informed when a block device is removed. Btrfs, for example, can handle surprise device (disk) removal but the existing Linux kernel handling doesn't cope well. File-systems implementing the "shutdown" call can not allow losing a device and end up shutting down the whole file-system.

[1]

Qu Wenruo of SUSE explains with the queued [2]patch :

"Currently all filesystems which implement super_operations::shutdown() can not afford losing a device.

Thus fs_bdev_mark_dead() will just call the ->shutdown() callback for the involved filesystem.

But it will no longer be the case, as multi-device filesystems like btrfs and bcachefs can handle certain device loss without the need to shutdown the whole filesystem.

To allow those multi-device filesystems to be integrated to use fs_holder_ops:

- Add a new super_operations::remove_bdev() callback

- Try ->remove_bdev() callback first inside fs_bdev_mark_dead() If the callback returned 0, meaning the fs can handling the device loss, then exit without doing anything else.

If there is no such callback or the callback returned non-zero value, continue to shutdown the filesystem as usual.

This means the new remove_bdev() should only do the check on whether the operation can continue, and if so do the fs specific handlings. The shutdown handling should still be handled by the existing ->shutdown() callback.

For all existing filesystems with shutdown callback, there is no change to the code nor behavior.

Btrfs is going to implement both the ->remove_bdev() and ->shutdown() callbacks soon."

That new support was merged today to Linux 6.17 via [3]this pull request .



[1] https://www.phoronix.com/image-viewer.php?id=2025&image=multi_disk_removal_lrg

[2] https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/commit/?h=vfs-6.17.super&id=d9c37a4904ec21ef7d45880fe023c11341869c28

[3] https://lore.kernel.org/lkml/20250725-vfs-super-5977952856e4@brauner/



Chugworth

Newton's Law of Gravitation:
What goes up must come down. But don't expect it to come down where
you can find it. Murphy's Law applies to Newton's.