RFC fsfreeze: new API
Get series with b4
b4 am 1311751806.2549.83.camel@nausicaaVersions newest first
- v1 RFC Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | fsfreeze: add vfs ioctl to check freeze statefs/ fs/ fs/ +1 more | +24 | 0 replies | |
| 2/4 | fsfreeze: add block device ioctl to check freeze stateblock/ block/ fs/ +1 more | +40 | 0 replies | |
| 3/4 | fsfreeze: add ioctl to create a fd for freeze controlfs/ fs/ include/ | +81 | 0 replies | |
| 4/4 | fsfreeze: add freeze fd ioctlsDocumentation/ fs/ include/ | +59 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC][PATCH 0/4] fsfreeze: new API
There are a few with issues with how freeze works in current kernels:
- Unmounting: It is possible to umount a frozen filesystem; the freeze code holds an active reference to the superblock so it does not go away. Since it is not possible to thaw by block device, thawing an unmounted filesystem involves mounting it again and using the current vfs freeze API.
- There is no check API: There is no easy way to know whether a filesystem is frozen or not.
- Foolproofness: Quite often the freeze/thaw process is handled from a daemon. In such cases we have to make really sure that the process does not go away or is killed while the filesystem is frozen; there is no check API so it is not always easy to figure out what is going on. With the advent of virtualization things got even funnier; in some cases not even the root user is aware of the existence of such daemon (usually a guest agent that freezes the guests filesystems before taking a storage snapshot).
I cooked some patches that add the long missing check ioctls and a new freeze API, which should (modulo bugs) the current situation:
- Check ioctls
[1/4] fsfreeze: add vfs ioctl to check freeze state
Adds a vfs ioctl to check the freeze state.
[2/4] fsfreeze: add block device ioctl to check freeze state
Adds a block device ioctl to check the freeze state. This is needed because it possible to umount frozen filesystems.
- New freeze API
[3/4] fsfreeze: add ioctl to create a fd for freeze control
Adds a new ioctl that freezes the indicated filesystem and returns a file descriptor; as long as that file descriptor is held open, the filesystem remains open.
[4/4] fsfreeze: add freeze fd ioctls
Adds new ioctls that operate on the file descriptor described in the previous patch; these can be used to freeze/thaw the filesystem and check the freeze state of the filesystem, thus avoiding the need to get new file descriptors constantly.