summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/fs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
index f2f4d5b747c5..a4758d94b32e 100644
--- a/fs/btrfs/fs.h
+++ b/fs/btrfs/fs.h
@@ -27,6 +27,7 @@
#include <linux/sched.h>
#include <linux/rbtree.h>
#include <linux/xxhash.h>
+#include <linux/fserror.h>
#include <uapi/linux/btrfs.h>
#include <uapi/linux/btrfs_tree.h>
#include "extent-io-tree.h"
@@ -1199,8 +1200,10 @@ static inline void btrfs_force_shutdown(struct btrfs_fs_info *fs_info)
* So here we only mark the fs error without flipping it RO.
*/
WRITE_ONCE(fs_info->fs_error, -EIO);
- if (!test_and_set_bit(BTRFS_FS_STATE_EMERGENCY_SHUTDOWN, &fs_info->fs_state))
+ if (!test_and_set_bit(BTRFS_FS_STATE_EMERGENCY_SHUTDOWN, &fs_info->fs_state)) {
btrfs_crit(fs_info, "emergency shutdown");
+ fserror_report_shutdown(fs_info->sb, GFP_KERNEL);
+ }
}
/*