fsfreeze: miscellaneous fixes and cleanups
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest17 patches 9 repliesIn review
- v59 patches 11 repliesSuperseded
- v4 RFC9 patches 19 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 RFC | 9 patches | 13 replies | Superseded | |
| v2 | 8 patches | 21 replies | Superseded | |
| v1 RFC | 7 patches | 11 replies | Superseded |
Changes since v4 from the cover letter
- Make implementation of iterate_supers_read and iterate_supers_write symmetric and update locking of emergency thaw code accordingly.
- Add Jan Kara's Reviewed-by to patch 2.
- Add explanation about the change from a block device based emergency thaw to a superblock based one to patch 4.
- Modify patch 7 so that the new superblock based emergency does not leave the block device level fsfreeze counter in an inconsistent state.
- Update and comment handling of fsfreeze during mount.
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | vfs: add __iterate_supers() and helpers around itfs/ fs/ fs/ +4 more | +55 | 0 replies | |
| 2/17 | fsfreeze: add unlocked version of thaw_superfs/ include/ | +33 | 0 replies | |
| 3/17 | fsfreeze: fix emergency thaw infinite loopfs/ | +5 | 0 replies | |
| 4/17 | fsfreeze: emergency thaw will deadlock on s_umountdrivers/ fs/ include/ | +23 | 1 reply | |
| 5/17 | xfs: switch to using super methods for fsfreezefs/ | +3 | 0 replies | |
| 6/17 | fsfreeze: move emergency thaw code to fs/super.cfs/ fs/ include/ | +52 | 0 replies | |
| 7/17 | fsfreeze: fix nested freezing of sb-less bdevsfs/ | +2 | 1 reply | |
| 8/17 | fsfreeze: allow bdev level thaws when the sb is unfrozenfs/ | +12 | 1 reply | |
| 9/17 | fsfreeze: freeze_super and thaw_bdev don't play well togetherfs/ fs/ fs/ +2 more | +81 | 0 replies | |
| 10/17 | fsfreeze: automatically thaw on umountfs/ fs/ include/ | +36 | 2 replies | |
| 11/17 | fsfreeze: add thaw_super_forcefs/ fs/ include/ | +79 | 0 replies | |
| 12/17 | fsfreeze: sb-level/bdev-level fsfreeze integrationfs/ fs/ fs/ +1 more | +104 | 2 replies | |
| 13/17 | fsfreeze: unfreeze bdevs in addition to filesystems during emergency thawfs/ fs/ include/ | +50 | 1 reply | |
| 14/17 | vfs: leverage bd_super in get_super and get_active_superfs/ | +26 | 1 reply | |
| 15/17 | btrfs: store pointer to superblock in bd_superfs/ fs/ fs/ | +33 | 0 replies | |
| 16/17 | fsfreeze: allow freeze counter lock nestingfs/ include/ | +13 | 0 replies | |
| 17/17 | fsfreeze: export freeze_count through mountinfofs/ | +2 | 0 replies |
Reviews trailers per patch
11 of 17 patches have a Reviewed-by or Acked-by.
| Patch | Eric Sandeen | Jan Kara |
|---|---|---|
| 1/17 | R-b | |
| 2/17 | R-b | R-b |
| 3/17 | R-b | R-b |
| 4/17 | R-b | |
| 5/17 | R-b | |
| 6/17 | R-b | |
| 7/17 | R-b | |
| 8/17 | R-b | |
| 9/17 | R-b | |
| 10/17 | ||
| 11/17 | ||
| 12/17 | ||
| 13/17 | R-b | |
| 14/17 | R-b | |
| 15/17 | ||
| 16/17 | ||
| 17/17 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 0/17] fsfreeze: miscellaneous fixes and cleanups
This patch set addresses several long standing issues:
- Fix emergency thaw (patch 1 through 4) and make some cleanups while at it (patches 5 and 6).
- Fix nested freezes for superblock-less block devices (patch 7).
- Integrate sb-level/bdev-level fsfreeze and sanitize the fsfreeze API to avoid perpetual frost in the event of changes in the filesystem namespace (patch 8 through 13).
- Add infrastructure needed to support dm-initiated freeze of filesystems spanning several bdevs and actually use it to implement this feature in btrfs (patch 14 through 16).
- Export freeze state to userspace through mountinfo (patch 17).
---
[1/17] vfs: add __iterate_supers() and helpers around it [2/17] fsfreeze: add unlocked version of thaw_super
Preparatory patches to fix s_umount lockup of emergency thaw code.
[3/17] fsfreeze: fix emergency thaw infinite loop
Fix thaw_bdev so that it propagates the error code properly to the caller. This bug caused emergency thaw to loop infinitely. This is a forward port of a previous patch by Dave Chinner.
[4/17] fsfreeze: emergency thaw will deadlock on s_umount
Avoid emergency thaw deadlock on s_umount by using unlocked version of thaw_super() and __iterate_supers() (introduced in patches 2 and 1 respectively).
[5/17] xfs: switch to using super methods for fsfreeze [6/17] fsfreeze: move emergency thaw code to fs/super.c
Two cleanups (based on previous patches by David Chinner): convert xfs to using superblock methods for fsfreeze and move emergency thaw code to where it belongs.
[7/17] fsfreeze: fix nested freezing of sb-less bdevs
Get nested freezes working for sb-less bdevs.
[8/17] fsfreeze: allow bdev level thaws when the sb is unfrozen [9/17] fsfreeze: freeze_super and thaw_bdev don't play well together
Restore the re-entrancy guards in sb-level API as the first step to achieve proper sb-level/bdev-level fsfreeze integration.
[10/17] fsfreeze: automatically thaw on umount
The fsfreeze ioctls are a sb-level API which means that to thaw a frozen filesystem it is necessary to have it in our filesystem hierarchy. To avoid being stuck with a frozen filesystem and frozen processes by accident, we automatically thaw filesystems on sys_umount().
[11/17] fsfreeze: add thaw_super_force
Both emergecy thaw and the umount-time automatic thaw need to make sure that the thaw operation does not fail so with some code refactoring we can share and clean up the code.
[12/17] fsfreeze: sb-level/bdev-level fsfreeze integration
[13/17] fsfreeze: unfreeze bdevs in addition to filesystems during emergency thaw
Fix the problem that a filesystem frozen through the bdev level API can be thawed using the superblock level API and make sure that their respective freeze counters are always consistent with each other.
[14/17] vfs: leverage bd_super in get_super and get_active_super [15/17] btrfs: store pointer to superblock in bd_super [16/17] fsfreeze: allow freeze counter lock nesting
Leverage bd_super in get_active_super to be able to get the superblock from the bdev when the filesystem spans several bdevs. Once this is in place, getting thaw_bdev(), i.e. dm snapshot, and btrfs to play well together is just a matter
of using bd_super in btrfs.
[17/17] fsfreeze: export freeze_count through mountinfo
Export freeze_count through mountinfo so that we have a way to figure out the current freeze state from userspace.
---
Changes since: v5:
- Fix patch 4 ("fsfreeze: emergency thaw will deadlock on s_umount").
- Add Jan Kara's Reviewed-by to patch 9 ("fsfreeze: freeze_super and thaw_bdev don't play well together").
- Exclude conflictive check ioctls from the patch set (could be back in a follow-up patch set) and add a patch to export freeze state to userspace through mountinfo.
- Add fix for nested freezing of sb-less bdevs.
- Rewrite the patches to integrate sb-level/bdev-level fsfreeze and sanitize the fsfreeze API (including automatical thawing of filesystems on umount).
- Add infrastructure needed to support dm-initiated freeze of filesystems spanning several bdevs and actually use it to implement this feature in btrfs.
Changes since v4:
- Make implementation of iterate_supers_read and iterate_supers_write symmetric and update locking of emergency thaw code accordingly.
- Add Jan Kara's Reviewed-by to patch 2.
- Add explanation about the change from a block device based emergency thaw to a superblock based one to patch 4.
- Modify patch 7 so that the new superblock based emergency does not leave the block device level fsfreeze counter in an inconsistent state.
- Update and comment handling of fsfreeze during mount.
Changes since v3:
- Include right version of the emergency thaw fix (thanks go to Josef for the heads up).
- Add iterate_supers_(read/write) helpers as suggested by Eric Sandeen.
- Fix typos.
- Add Eric Sandeen's Reviewed-by to patches 2 and 3.
Changes since v2:
- Rebase on top of Jan Kara's patch set which made it upstream.
- Do without the horrible "emergency" parameter as suggested by Jan Kara.
- New approach to fix emergency thaw deadlock on s_umount which does locking properly.
Changes since v1:
- Do not break unfreezing of block devices without a mounted filesystem.
- Avoid conditional locking in thaw_bdev.
- Update filesystem locking documentation.