scoutfs: don't try to sync on mount errors

kill_sb tries to sync before calling kill_block_super.   It shouldn't do
this on mount errors that wouldn't have initialized the higher level
systems needed for syncing.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-05-01 14:49:14 -07:00
parent 66dd35b9a5
commit c678923401
2 changed files with 9 additions and 2 deletions

View File

@@ -1951,6 +1951,7 @@ int scoutfs_net_setup(struct super_block *sb)
*/
void scoutfs_net_destroy(struct super_block *sb)
{
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
DECLARE_NET_INFO(sb, nti);
struct sock_info *sinf;
struct sock_info *pos;
@@ -1987,5 +1988,6 @@ void scoutfs_net_destroy(struct super_block *sb)
/* and free all resources */
free_sbuf_list(sb, &nti->to_send, -ESHUTDOWN);
free_nti(nti);
sbi->net_info = NULL;
}
}

View File

@@ -259,8 +259,12 @@ static void scoutfs_kill_sb(struct super_block *sb)
{
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
/* make sure all dirty work is settled before killing the super */
if (sbi) {
/*
* If we had successfully mounted then make sure dirty data
* writeback and compaction is done before we kill the block
* super and start tearing everything down.
*/
if (sb->s_root) {
sync_filesystem(sb);
scoutfs_lock_shutdown(sb);
@@ -271,6 +275,7 @@ static void scoutfs_kill_sb(struct super_block *sb)
if (sbi) {
scoutfs_lock_destroy(sb);
scoutfs_net_destroy(sb);
scoutfs_shutdown_trans(sb);
scoutfs_data_destroy(sb);
scoutfs_inode_destroy(sb);