diff options
author | Brian Foster <bfoster@redhat.com> | 2023-11-30 22:17:11 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 19:47:40 +0300 |
commit | d9e14a4eb9902bac1e6fb779eb6c41629652cbd8 (patch) | |
tree | 22fb8baac6cdc671d69a06e7d3401d2062d28a54 /fs/bcachefs/trace.h | |
parent | a56c61714a2d2e548f5c3792130149159e0657ed (diff) | |
download | linux-d9e14a4eb9902bac1e6fb779eb6c41629652cbd8.tar.xz |
bcachefs: remove sb lock and flags update on explicit shutdown
bcachefs grabs s_umount and sets SB_RDONLY when the fs is shutdown
via the ioctl() interface. This has a couple issues related to
interactions between shutdown and freeze:
1. The flags == FSOP_GOING_FLAGS_DEFAULT case is a deadlock vector
because freeze_bdev() calls into freeze_super(), which also
acquires s_umount.
2. If an explicit shutdown occurs while the sb is frozen, SB_RDONLY
alters the thaw path as if the sb was read-only at freeze time.
This effectively leaks the frozen state and leaves the sb frozen
indefinitely.
The usage of SB_RDONLY here goes back to the initial bcachefs commit
and AFAICT is simply historical behavior. This behavior is unique to
bcachefs relative to the handful of other filesystems that support
the shutdown ioctl(). Typically, SB_RDONLY is reserved for the
proper remount path, which itself is restricted from modifying
frozen superblocks in reconfigure_super(). Drop the unnecessary sb
lock and flags update bch2_ioc_goingdown() to address both of these
issues.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/trace.h')
0 files changed, 0 insertions, 0 deletions