--- a/fs/reiserfs/super.c 2017-05-29 00:14:45.000000000 -0400 +++ b/fs/reiserfs/super.c 2017-05-29 00:51:44.000000000 -0400 @@ -67,17 +67,28 @@ static int reiserfs_sync_fs(struct super_block *s, int wait) { struct reiserfs_transaction_handle th; + int got_lock; /* * Writeback quota in non-journalled quota case - journalled quota has * no dirty dquots */ + + if ( down_read_trylock(&s->s_umount) ) + got_lock = 1; + else + got_lock = 0; + dquot_writeback_dquots(s, -1); reiserfs_write_lock(s); if (!journal_begin(&th, s, 1)) if (!journal_end_sync(&th)) reiserfs_flush_old_commits(s); reiserfs_write_unlock(s); + + if ( got_lock ) + up_read(&s->s_umount); + return 0; }