Skip to content

RFC fs: generic filesystem shutdown handling

Jan Kara linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest13 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13fs: Define bit numbers for SB_I_ flagsinclude/linux/fs.h+34 -00 replies
2/13fs: Convert fs_context use of SB_I_ flags to new constantsblock/bdev.c fs/aio.c fs/nfs/fs_context.c+3 -30 replies
3/13fs: Convert mount_too_revealing() to new s_iflags handling functionsfs/namespace.c+4 -70 replies
4/13fs: Convert remaining usage of SB_I_ flagsdrivers/android/binderfs.c fs/btrfs/super.c fs/devpts/inode.c +22 more+44 -400 replies
5/13fs: Drop old SB_I_ constantsinclude/linux/fs.h+0 -170 replies
6/13fs: Drop unnecessary underscore from _SB_I_ constantsblock/bdev.c drivers/android/binderfs.c fs/aio.c +26 more+63 -634 replies
7/13overlayfs: Make ovl_start_write() return errorfs/overlayfs/copy_up.c fs/overlayfs/overlayfs.h fs/overlayfs/util.c+36 -111 reply
8/13fs: Teach callers of kiocb_start_write() to handle errorsfs/aio.c fs/read_write.c include/linux/fs.h +1 more+19 -90 replies
9/13fs: Teach callers of file_start_write() to handle errorsfs/backing-file.c fs/btrfs/ioctl.c fs/coredump.c +6 more+42 -150 replies
10/13fs: Add __must_check annotations to sb_start_write_trylock() and similarinclude/linux/fs.h+4 -30 replies
11/13fs: Make sb_start_write() return error on shutdown filesystemfs/btrfs/block-group.c fs/btrfs/defrag.c fs/btrfs/volumes.c +7 more+46 -190 replies
12/13fs: Make sb_start_pagefault() return error on shutdown filesystemfs/bcachefs/fs-io-pagecache.c fs/btrfs/file.c fs/ceph/addr.c +16 more+45 -210 replies
13/13ext4: Replace EXT4_FLAGS_SHUTDOWN flag with a generic SB_I_SHUTDOWNfs/ext4/ext4.h fs/ext4/ioctl.c fs/ext4/super.c+9 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/13] fs: generic filesystem shutdown handling

Hello,

this patch series implements generic handling of filesystem shutdown. The idea is very simple: Have a superblock flag, which when set, will make VFS refuse modifications to the filesystem. The patch series consists of several parts. Patches 1-6 cleanup handling of SB_I_ flags which is currently messy (different flags seem to have different locks protecting them although they are modified by plain stores). Patches 7-12 gradually convert code to be able to handle errors from sb_start_write() / sb_start_pagefault(). Patch 13 then shows how filesystems can use this generic flag. Additionally, we could remove some shutdown checks from within ext4 code and rely on checks in VFS but I didn't want to complicate the series with ext4 specific things.

Also, as Dave suggested, we can lift *_IOC_{SHUTDOWN|GOINGDOWN} ioctl handling to VFS (currently in 5 filesystems) and just call new ->shutdown op for the filesystem abort handling itself. But that is kind of independent thing and this series is long enough as is.

So what do people think?

Honza