Commit b4b9d34 Jaegeuk Kim
committed
1 parent bdb7d96 commit b4b9d34 Copy full SHA for b4b9d34
File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -800,13 +800,17 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
800
800
801
801
static int f2fs_freeze (struct super_block * sb )
802
802
{
803
- int err ;
804
-
805
803
if (f2fs_readonly (sb ))
806
804
return 0 ;
807
805
808
- err = f2fs_sync_fs (sb , 1 );
809
- return err ;
806
+ /* IO error happened before */
807
+ if (unlikely (f2fs_cp_error (F2FS_SB (sb ))))
808
+ return - EIO ;
809
+
810
+ /* must be clean, since sync_filesystem() was already called */
811
+ if (is_sbi_flag_set (F2FS_SB (sb ), SBI_IS_DIRTY ))
812
+ return - EINVAL ;
813
+ return 0 ;
810
814
}
811
815
812
816
static int f2fs_unfreeze (struct super_block * sb )
@@ -2152,3 +2156,4 @@ module_exit(exit_f2fs_fs)
2152
2156
MODULE_AUTHOR ("Samsung Electronics's Praesto Team" );
2153
2157
MODULE_DESCRIPTION ("Flash Friendly File System" );
2154
2158
MODULE_LICENSE ("GPL" );
2159
+
You can’t perform that action at this time.
0 commit comments