[PATCH 0/8 v2] fsfreeze: miscellaneous fixes and cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


This patch set (probable the first of a series) is to address long standing
issues in the filesytem freeze code and to fill some functionality gaps in the
API. Some minor code rearrangements are included too.

The first 5 patches are a rehash of a previous patch set from Dave Chinner which
I ported to the latest -rc kernel (3.5.0-rc5 at the time of writing) and
updated to fix bugs and reflect previous feedback from Christoph Hellwig and
Al Viro.

Dave, I took the liberty of adding your Signed-off-by as the author of the
original patches. If you do not agree with my modifications or want me to
acknowledge you differently please let me know.

You can find the original discussion here:
http://www.spinics.net/lists/linux-fsdevel/msg32794.html

The last 2 patches add a block device based check ioctl and superblock based
check ioctl.

More details follow below:

---
[1/8] fsfreeze: Prevent emergency thaw from looping infinitely
[2/8] fsfreeze: emergency thaw will deadlock on s_umount

This two patches fix the emergency thaw infinite loop reported by Jeff
Merkey and the deadlock on sb->s_umount that the infinite loop hid. These may
be stable kernel candidates.

[3/8] fsfreeze: freeze_super and thaw_bdev don't play well together
[4/8] fsfreeze: switch to using super methods where possible
[5/8] fsfreeze: move emergency thaw code to fs/super.c

These patches address the bdev/sb mismatch and the fact that sb level freezing
does not nest correctly. For all the places that the block device interfaces
are used, we need a superblock anyway so we may as well make freeze/thaw work
only at the superblock level. There is one caveat (pointed out by Christoph in
the discussion linked above) though: we still need to support the "feature"
that we can freeze a block device that does not have a filesystem mounted yet
(this can be used to prevent a filesystem mount during a dm snapshot for
example).

This series moves part of the nesting code to the superblock from the block
device level but retains the freeze_bdev/thaw_bdev API so that we can keep the
"feature" mentioned above for those who may need it, namely dm and external
users (yes, block device level API is exported for external use). All the other
users of the block device API are converted to work at the superblock level.

[6/8] fsfreeze: add vfs ioctl to check freeze state
[7/8] fsfreeze: add block device ioctl to check freeze state

These ioctls can be used to by HA and monitoring software to check the freeze
state of block device and filesystems.

[8/8] fsfreeze: update Documentation/filesystems/Locking

Documentation and implementation got out of sync.
---

In a follow-up patch I would like to tackle (second try) a big outstanding
problem: a frozen filesystem can be unmounted but with the current API one
needs to open a file in the target superblock, which is no longer accessible
because it has been unmounted.

Possible approaches to fix this issue include:

1- Add a block device level API to unfreeze the filesystem.

The problem with this approach is that it does not play well with filesystems
sb/bdev association is 1:n (i.e. btrfs and that ilk).

2- Disallow umount on frozen filesystems.

I think this is the more reasonable solution but it may require a refactoring
of the lazy unmount code; a lazy unmount should only be allowed to succeed if
both the target filesystem and all its child mounts are unfrozen (a failure to
guarantee this can lead to a situation where the user cannot unfreeze a
filesystem in the hierarchy because it is not visible).

3- Automatically thaw the filesystem on unmount.

Probably not a good idea.

Changes since v1:
  - Do not break unfreezing of block devices without a mounted filesystem.
  - Avoid conditional locking in thaw_bdev.
  - Update filesystem locking documentation.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Ext4 Filesystem]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [CEPH Filesystem]


  Powered by Linux