fs: support freeze/thaw/mark_dead/sync with shared devices#920
Open
blktests-ci[bot] wants to merge 8 commits into
Open
fs: support freeze/thaw/mark_dead/sync with shared devices#920blktests-ci[bot] wants to merge 8 commits into
blktests-ci[bot] wants to merge 8 commits into
Conversation
Author
|
Upstream branch: e43ffb6 |
c6dc343 to
fc36596
Compare
blk_mode_t and fop_flags_t are both plain 'unsigned int __bitwise' flag typedefs, exactly like the gfp_t, slab_flags_t and fmode_t that already live in <linux/types.h>. Move them there so they are available everywhere without having to drag in a subsystem header. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs_holder_ops recovers the owning superblock from bdev->bd_holder, which forces the holder to be exactly one superblock and prevents several superblocks from sharing one block device. That's what erofs is doing. Introduce a global dev_t-keyed rhltable mapping each block device to the superblock(s) using it. The holder argument becomes purely the block layer's exclusivity token (a superblock, or a file_system_type for shared devices) and is no longer needed by the fs specific callbacks. Registration keeps one entry per (device, superblock). When a filesystem claims a device it already uses (xfs with its log on the data device), no second entry is added, so each superblock is acted on once. Each table entry holds a passive reference (s_count) on its superblock, so the struct stays valid for as long as the entry is reachable. The callbacks look the device up in the table and act on every superblock using it: Unlinking an entry is deferred to the last unpin, so a cursor never resumes from a removed node. After this it's possible to act on all superblocks that share a given device. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
setup_bdev_super() already refuses to bring a filesystem up on a frozen
block device but only for the primary device. Now that filesystems claim
every device through fs_bdev_file_open_by_{dev,path}(), do that check
once in the registration helper so it covers all of them.
Drop the now-redundant check from setup_bdev_super().
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Route opens through fs_bdev_file_open_by_path() so each external device is registered against mp->m_super, and convert the matching releases. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Route opens through fs_bdev_file_open_by_path() so each external device is registered against the correct superblock, and convert the matching releases. The temporary identification opens that only read the superblock and close again pass a NULL holder and are left untouched. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Route opens through fs_bdev_file_open_by_path() so each external device is registered against the correct superblock, and convert the matching releases. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Route opens through fs_bdev_file_open_by_path() so each external device is registered against the correct superblock, and convert the matching releases. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
There's no need to expose it anymore. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Author
|
Upstream branch: ba3e43a |
a9bf794 to
53a975c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: fs: support freeze/thaw/mark_dead/sync with shared devices
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1104553