Files
scoutfs/kmod/src
Zach Brown e15eb13ec9 scoutfs: centralize teardown in put_super
We were trying to tear down our mounted file system resources in the
->kill_sb() callback.  This happens relatively early in the unmount
process.  We call kill_block_super() in our teardown which syncs the
mount and tears down the vfs structures.  By tearing down in ->kill_sb()
we were forced to juggle tearing down before and after the call to
kill_block_super().

When we got that wrong we'd tear down too many resources and crash in
kill_block_super() or we wouldn't tear down enough and leave work still
pending that'd explode as we tried to shut down after
kill_block_super().

It turns out the vfs has a callback specifcally to solve this ordering
problem.  The put_super callback is called after having synced the mount
but before its totally torn down.  By putting all our shutdown in there
we no longer have to worry about racing with active use.

Auditing the shutdown dependencies also found some bad cases where we
were tearding down subsystems that were still in use.  The biggest
problem was shutting down locking and networking before shutting down
the transaction processing which relies on both.   Now we first shut
down all the client processing, then all the server processing, then the
lowest level common infrastructure.

The trickiest part in understanding this is knowing that
kill_block_super() only calls put_super during mount failure if mount
got far enough to assign the root dentry to s_root.  We call put_super
manually ourselves in mount failure if it didn't get far enough so that
all teardown goes through put_super.  (You'll see this s_root test in
other upstream file system error paths.)

Finally while auding the setup and shutdown paths I noticed a few, trans
and counters, that needed simple fixes to properly cleanup errors and
only shutdown if they've been setup.

This all was stressed with an xfstests that races mount and unmount
across the cluster.  Before this change it'd crash/hang almost instantly
and with this change it runs to completion.

Signed-off-by: Zach Brown <zab@versity.com>
2017-12-08 13:22:11 -06:00
..
2017-09-28 13:59:49 -07:00
2017-04-18 13:44:54 -07:00
2017-10-12 13:57:31 -07:00
2017-08-11 10:43:35 -07:00
2017-04-18 13:44:53 -07:00
2017-10-12 13:59:52 -07:00
2017-11-08 13:37:16 -08:00
2017-10-18 13:23:01 -07:00
2017-08-30 10:38:00 -07:00
2017-10-18 13:23:01 -07:00
2017-10-12 13:57:31 -07:00
2016-02-05 14:12:14 -08:00
2017-09-19 11:25:38 -07:00
2017-04-18 13:51:10 -07:00
2017-10-12 13:57:31 -07:00
2017-06-23 15:08:02 -05:00
2017-06-23 15:08:02 -05:00
2017-11-30 13:13:45 -06:00
2017-11-30 13:13:45 -06:00
2017-10-12 13:57:31 -07:00
2017-10-26 14:47:59 -07:00
2017-04-18 13:44:54 -07:00