Skip to contentSkip to conversation

f2fs: release reserved blocks for quota

PATCH In review LiFan 2 participants 2 messages Dec 5, 2017 – Dec 8, 2017 1 message not in the archive F2FS file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20171205075320epcas5p3c146367a8d57d8b4617085982b195e40@epcas5p3.samsung.com

LiFan

author
#1 lore raw

PATCH 1/1 f2fs: release reserved blocks for quota

Quota has been modified during inc_valid_block_count(), but not in truncate process. This patch adds it.

---
 fs/f2fs/f2fs.h | 2 ++
 1 file changed, 2 insertions(+)
fs/f2fs/f2fs.h +2 -0
index 82f1dc3..71fbba96 100644
@@ -1619,7 +1619,9 @@ static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,
 		sbi->current_reserved_blocks = min(sbi->reserved_blocks,
 					sbi->current_reserved_blocks + count);
 	spin_unlock(&sbi->stat_lock);
+
 	f2fs_i_blocks_write(inode, count, false, true);
+	dquot_release_reservation_block(inode, count);
 }
 
 static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type)
Signature · 1 line
2.7.4
maintainer
#2 lore raw
Quoted 14 lines · LiFan

Quota has been modified during inc_valid_block_count(), but not in truncate process. This patch adds it.

---
 fs/f2fs/f2fs.h | 2 ++
 1 file changed, 2 insertions(+)
fs/f2fs/f2fs.h +0 -0
index 82f1dc3..71fbba96 100644

fs/f2fs/f2fs.h static inline void dec_valid_block_count(struct f2fs_sb_info *sbi, · line 1624

Quoted 6 lines
fs/f2fs/f2fs.h +2 -0
@@ -1619,7 +1619,9 @@ static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,
 		sbi->current_reserved_blocks = min(sbi->reserved_blocks,
 					sbi->current_reserved_blocks + count);
 	spin_unlock(&sbi->stat_lock);
+
 	f2fs_i_blocks_write(inode, count, false, true);
+	dquot_release_reservation_block(inode, count);

The f2fs_i_blocks_write() actually handles allocation, and reserved blocks are only used for inc_valid_block_count().

Thanks,

Quoted 6 lines
fs/f2fs/f2fs.h +0 -0
 }
 
 static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type)
Signature · 1 line
2.7.4