|
@@ -487,7 +487,8 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
|
|
if (sync) {
|
|
if (sync) {
|
|
struct cp_control cpc;
|
|
struct cp_control cpc;
|
|
|
|
|
|
- cpc.reason = test_opt(sbi, FASTBOOT) ? CP_UMOUNT : CP_SYNC;
|
|
|
|
|
|
+ cpc.reason = (test_opt(sbi, FASTBOOT) || sbi->s_closing) ?
|
|
|
|
+ CP_UMOUNT : CP_SYNC;
|
|
mutex_lock(&sbi->gc_mutex);
|
|
mutex_lock(&sbi->gc_mutex);
|
|
write_checkpoint(sbi, &cpc);
|
|
write_checkpoint(sbi, &cpc);
|
|
mutex_unlock(&sbi->gc_mutex);
|
|
mutex_unlock(&sbi->gc_mutex);
|
|
@@ -1190,11 +1191,18 @@ static struct dentry *f2fs_mount(struct file_system_type *fs_type, int flags,
|
|
return mount_bdev(fs_type, flags, dev_name, data, f2fs_fill_super);
|
|
return mount_bdev(fs_type, flags, dev_name, data, f2fs_fill_super);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void kill_f2fs_super(struct super_block *sb)
|
|
|
|
+{
|
|
|
|
+ if (sb->s_root)
|
|
|
|
+ F2FS_SB(sb)->s_closing = true;
|
|
|
|
+ kill_block_super(sb);
|
|
|
|
+}
|
|
|
|
+
|
|
static struct file_system_type f2fs_fs_type = {
|
|
static struct file_system_type f2fs_fs_type = {
|
|
.owner = THIS_MODULE,
|
|
.owner = THIS_MODULE,
|
|
.name = "f2fs",
|
|
.name = "f2fs",
|
|
.mount = f2fs_mount,
|
|
.mount = f2fs_mount,
|
|
- .kill_sb = kill_block_super,
|
|
|
|
|
|
+ .kill_sb = kill_f2fs_super,
|
|
.fs_flags = FS_REQUIRES_DEV,
|
|
.fs_flags = FS_REQUIRES_DEV,
|
|
};
|
|
};
|
|
MODULE_ALIAS_FS("f2fs");
|
|
MODULE_ALIAS_FS("f2fs");
|