]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - fs/gfs2/inode.c
GFS2: update freeze code to use freeze/thaw_super on all nodes
authorBenjamin Marzinski <bmarzins@redhat.com>
Fri, 14 Nov 2014 02:42:04 +0000 (20:42 -0600)
committerSteven Whitehouse <swhiteho@redhat.com>
Mon, 17 Nov 2014 10:36:39 +0000 (10:36 +0000)
commit2e60d7683c8d2ea21317f6d9f4cd3bf5428ce162
treefc7900ad18814d1ea46879f93eab063ff5754d1e
parent48b6bca6b7b8309697fc8a101793befe92d249d9
GFS2: update freeze code to use freeze/thaw_super on all nodes

The current gfs2 freezing code is considerably more complicated than it
should be because it doesn't use the vfs freezing code on any node except
the one that begins the freeze.  This is because it needs to acquire a
cluster glock before calling the vfs code to prevent a deadlock, and
without the new freeze_super and thaw_super hooks, that was impossible. To
deal with the issue, gfs2 had to do some hacky locking tricks to make sure
that a frozen node couldn't be holding on a lock it needed to do the
unfreeze ioctl.

This patch makes use of the new hooks to simply the gfs2 locking code. Now,
all the nodes in the cluster freeze and thaw in exactly the same way. Every
node in the cluster caches the freeze glock in the shared state.  The new
freeze_super hook allows the freezing node to grab this freeze glock in
the exclusive state without first calling the vfs freeze_super function.
All the nodes in the cluster see this lock change, and call the vfs
freeze_super function. The vfs locking code guarantees that the nodes can't
get stuck holding the glocks necessary to unfreeze the system.  To
unfreeze, the freezing node uses the new thaw_super hook to drop the freeze
glock. Again, all the nodes notice this, reacquire the glock in shared mode
and call the vfs thaw_super function.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/glops.c
fs/gfs2/glops.h
fs/gfs2/incore.h
fs/gfs2/inode.c
fs/gfs2/log.c
fs/gfs2/main.c
fs/gfs2/ops_fstype.c
fs/gfs2/super.c
fs/gfs2/super.h
fs/gfs2/trans.c