linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: release reserved blocks for quota
       [not found] <CGME20171205075320epcas5p3c146367a8d57d8b4617085982b195e40@epcas5p3.samsung.com>
@ 2017-12-05  7:52 ` LiFan
  2017-12-08  5:24   ` Jaegeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: LiFan @ 2017-12-05  7:52 UTC (permalink / raw)
  To: 'Chao Yu', 'Chao Yu', 'Jaegeuk Kim'
  Cc: linux-kernel, linux-f2fs-devel


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

Signed-off-by: Fan li <fanofcode.li@samsung.com>
---
 fs/f2fs/f2fs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 82f1dc3..71fbba96 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: release reserved blocks for quota
  2017-12-05  7:52 ` [f2fs-dev] [PATCH] f2fs: release reserved blocks for quota LiFan
@ 2017-12-08  5:24   ` Jaegeuk Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Jaegeuk Kim @ 2017-12-08  5:24 UTC (permalink / raw)
  To: LiFan
  Cc: 'Chao Yu', 'Chao Yu', linux-kernel, linux-f2fs-devel

On 12/05, LiFan wrote:
> 
> Quota has been modified during inc_valid_block_count(), but not in
> truncate process. This patch adds it.
> 
> Signed-off-by: Fan li <fanofcode.li@samsung.com>
> ---
>  fs/f2fs/f2fs.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 82f1dc3..71fbba96 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -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,

>  }
>  
>  static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type)
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-08  5:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20171205075320epcas5p3c146367a8d57d8b4617085982b195e40@epcas5p3.samsung.com>
2017-12-05  7:52 ` [f2fs-dev] [PATCH] f2fs: release reserved blocks for quota LiFan
2017-12-08  5:24   ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).