Skip to contentSkip to conversation

f2fs: turn quota off when error occurs

PATCH In review Jaegeuk Kim 2 participants 4 messages Oct 20, 2017 – Oct 23, 2017

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: turn quota off when error occurs

Before changing readonly, it needs to turn quota off.

---
 fs/f2fs/checkpoint.c | 1 +
 1 file changed, 1 insertion(+)
fs/f2fs/checkpoint.c +1 -0
index 201608281681..ff74665d7f2d 100644
@@ -29,6 +29,7 @@ struct kmem_cache *inode_entry_slab;
 void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
 {
 	set_ckpt_flags(sbi, CP_ERROR_FLAG);
+	f2fs_quota_off_umount(sb);
 	sbi->sb->s_flags |= MS_RDONLY;
 	if (!end_io)
 		f2fs_flush_merged_writes(sbi);
Signature · 1 line
2.14.0.rc1.383.gd1ce394fe2-goog
maintainer
#1 lore raw
Quoted 12 lines · Jaegeuk Kim

Before changing readonly, it needs to turn quota off.

---
 fs/f2fs/checkpoint.c | 1 +
 1 file changed, 1 insertion(+)
fs/f2fs/checkpoint.c +0 -0
index 201608281681..ff74665d7f2d 100644

fs/f2fs/checkpoint.c struct kmem_cache *inode_entry_slab; · line 34

Quoted 6 lines
fs/f2fs/checkpoint.c +1 -0
@@ -29,6 +29,7 @@ struct kmem_cache *inode_entry_slab;
 void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
 {
 	set_ckpt_flags(sbi, CP_ERROR_FLAG);
+	f2fs_quota_off_umount(sb);
 	sbi->sb->s_flags |= MS_RDONLY;
 	if (!end_io)

Oh, f2fs_stop_checkpoint can be called from end_io, how about adding f2fs_quota_off_umount here?

Thanks,

Quoted 2 lines
fs/f2fs/checkpoint.c +0 -0
 		f2fs_flush_merged_writes(sbi);
author maintainer
#2 lore raw
Quoted 8 lines · Chao Yu
Quoted 7 lines · Jaegeuk Kim

Before changing readonly, it needs to turn quota off.

---
 fs/f2fs/checkpoint.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 14 lines

fs/f2fs/checkpoint.c struct kmem_cache *inode_entry_slab; · line 34

Quoted 11 lines
fs/f2fs/checkpoint.c +1 -0
index 201608281681..ff74665d7f2d 100644
@@ -29,6 +29,7 @@ struct kmem_cache *inode_entry_slab;
 void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
 {
 	set_ckpt_flags(sbi, CP_ERROR_FLAG);
+	f2fs_quota_off_umount(sb);
 	sbi->sb->s_flags |= MS_RDONLY;
 	if (!end_io)

Oh, f2fs_stop_checkpoint can be called from end_io, how about adding f2fs_quota_off_umount here?

Agreed.

---
 fs/f2fs/checkpoint.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
fs/f2fs/checkpoint.c +6 -2
index 201608281681..b38b1ae59124 100644
@@ -29,9 +29,13 @@ struct kmem_cache *inode_entry_slab;
 void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
 {
 	set_ckpt_flags(sbi, CP_ERROR_FLAG);
-	sbi->sb->s_flags |= MS_RDONLY;
-	if (!end_io)
+	if (!end_io) {
+		f2fs_quota_off_umount(sbi->sb);
+		sbi->sb->s_flags |= MS_RDONLY;
 		f2fs_flush_merged_writes(sbi);
+	} else {
+		sbi->sb->s_flags |= MS_RDONLY;
+	}
 }
 
 /*
Signature · 1 line
2.14.0.rc1.383.gd1ce394fe2-goog
maintainer Reviewed-by
#3 lore raw
Quoted 24 lines · Jaegeuk Kim
Quoted 8 lines · Chao Yu
Quoted 7 lines · Jaegeuk Kim

Before changing readonly, it needs to turn quota off.

---
 fs/f2fs/checkpoint.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 14 lines

fs/f2fs/checkpoint.c struct kmem_cache *inode_entry_slab; · line 34

Quoted 11 lines
fs/f2fs/checkpoint.c +1 -0
index 201608281681..ff74665d7f2d 100644
@@ -29,6 +29,7 @@ struct kmem_cache *inode_entry_slab;
 void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
 {
 	set_ckpt_flags(sbi, CP_ERROR_FLAG);
+	f2fs_quota_off_umount(sb);
 	sbi->sb->s_flags |= MS_RDONLY;
 	if (!end_io)

Oh, f2fs_stop_checkpoint can be called from end_io, how about adding f2fs_quota_off_umount here?

Quoted 3 lines

Agreed.

Thanks,

Quoted 25 lines
---
 fs/f2fs/checkpoint.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
fs/f2fs/checkpoint.c +6 -2
index 201608281681..b38b1ae59124 100644
@@ -29,9 +29,13 @@ struct kmem_cache *inode_entry_slab;
 void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
 {
 	set_ckpt_flags(sbi, CP_ERROR_FLAG);
-	sbi->sb->s_flags |= MS_RDONLY;
-	if (!end_io)
+	if (!end_io) {
+		f2fs_quota_off_umount(sbi->sb);
+		sbi->sb->s_flags |= MS_RDONLY;
 		f2fs_flush_merged_writes(sbi);
+	} else {
+		sbi->sb->s_flags |= MS_RDONLY;
+	}
 }
 
 /*