linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors
@ 2024-03-20  6:22 Zhiguo Niu
  2024-03-20  9:33 ` Chao Yu
  2024-04-14 15:32 ` patchwork-bot+f2fs
  0 siblings, 2 replies; 5+ messages in thread
From: Zhiguo Niu @ 2024-03-20  6:22 UTC (permalink / raw)
  To: jaegeuk, chao
  Cc: ke.wang, linux-kernel, linux-f2fs-devel, hongyu.jin, zhiguo.niu

some user behaviors requested filesystem operations, which
will cause filesystem not idle.
Meanwhile adjust some f2fs_update_time(REQ_TIME) positions.

Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
---
v3: modify some update conditions according to Chao's suggeestions
v2: update patch according to Chao's suggestions
---
---
 fs/f2fs/file.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 1761ad1..128e53d 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2354,13 +2354,14 @@ static bool uuid_is_nonzero(__u8 u[16])
 static int f2fs_ioc_set_encryption_policy(struct file *filp, unsigned long arg)
 {
 	struct inode *inode = file_inode(filp);
+	int ret;
 
 	if (!f2fs_sb_has_encrypt(F2FS_I_SB(inode)))
 		return -EOPNOTSUPP;
 
+	ret = fscrypt_ioctl_set_policy(filp, (const void __user *)arg);
 	f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
-
-	return fscrypt_ioctl_set_policy(filp, (const void __user *)arg);
+	return ret;
 }
 
 static int f2fs_ioc_get_encryption_policy(struct file *filp, unsigned long arg)
@@ -2786,7 +2787,8 @@ static int f2fs_ioc_defragment(struct file *filp, unsigned long arg)
 	err = f2fs_defragment_range(sbi, filp, &range);
 	mnt_drop_write_file(filp);
 
-	f2fs_update_time(sbi, REQ_TIME);
+	if (range.len)
+		f2fs_update_time(sbi, REQ_TIME);
 	if (err < 0)
 		return err;
 
@@ -3600,6 +3602,8 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
 	filemap_invalidate_unlock(inode->i_mapping);
 	f2fs_up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
 out:
+	if (released_blocks)
+		f2fs_update_time(sbi, REQ_TIME);
 	inode_unlock(inode);
 
 	mnt_drop_write_file(filp);
@@ -3770,6 +3774,8 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
 		f2fs_mark_inode_dirty_sync(inode, true);
 	}
 unlock_inode:
+	if (reserved_blocks)
+		f2fs_update_time(sbi, REQ_TIME);
 	inode_unlock(inode);
 	mnt_drop_write_file(filp);
 
@@ -3966,6 +3972,7 @@ static int f2fs_sec_trim_file(struct file *filp, unsigned long arg)
 	if (len)
 		ret = f2fs_secure_erase(prev_bdev, inode, prev_index,
 				prev_block, len, range.flags);
+	f2fs_update_time(sbi, REQ_TIME);
 out:
 	filemap_invalidate_unlock(mapping);
 	f2fs_up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
@@ -4175,6 +4182,7 @@ static int f2fs_ioc_decompress_file(struct file *filp)
 	if (ret)
 		f2fs_warn(sbi, "%s: The file might be partially decompressed (errno=%d). Please delete the file.",
 			  __func__, ret);
+	f2fs_update_time(sbi, REQ_TIME);
 out:
 	inode_unlock(inode);
 	file_end_write(filp);
@@ -4254,6 +4262,7 @@ static int f2fs_ioc_compress_file(struct file *filp)
 	if (ret)
 		f2fs_warn(sbi, "%s: The file might be partially compressed (errno=%d). Please delete the file.",
 			  __func__, ret);
+	f2fs_update_time(sbi, REQ_TIME);
 out:
 	inode_unlock(inode);
 	file_end_write(filp);
-- 
1.9.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors
  2024-03-20  6:22 [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors Zhiguo Niu
@ 2024-03-20  9:33 ` Chao Yu
  2024-04-10  7:19   ` Zhiguo Niu
  2024-04-14 15:32 ` patchwork-bot+f2fs
  1 sibling, 1 reply; 5+ messages in thread
From: Chao Yu @ 2024-03-20  9:33 UTC (permalink / raw)
  To: Zhiguo Niu, jaegeuk; +Cc: hongyu.jin, ke.wang, linux-kernel, linux-f2fs-devel

On 2024/3/20 14:22, Zhiguo Niu wrote:
> some user behaviors requested filesystem operations, which
> will cause filesystem not idle.
> Meanwhile adjust some f2fs_update_time(REQ_TIME) positions.
> 
> Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors
  2024-03-20  9:33 ` Chao Yu
@ 2024-04-10  7:19   ` Zhiguo Niu
  2024-04-12 20:53     ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Zhiguo Niu @ 2024-04-10  7:19 UTC (permalink / raw)
  To: jaegeuk; +Cc: ke.wang, linux-kernel, linux-f2fs-devel, hongyu.jin, Zhiguo Niu

Hi Jaegeuk
Any comments about this patch?
thanks!

On Wed, Mar 20, 2024 at 5:33 PM Chao Yu <chao@kernel.org> wrote:
>
> On 2024/3/20 14:22, Zhiguo Niu wrote:
> > some user behaviors requested filesystem operations, which
> > will cause filesystem not idle.
> > Meanwhile adjust some f2fs_update_time(REQ_TIME) positions.
> >
> > Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
>
> Reviewed-by: Chao Yu <chao@kernel.org>
>
> Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors
  2024-04-10  7:19   ` Zhiguo Niu
@ 2024-04-12 20:53     ` Jaegeuk Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Jaegeuk Kim @ 2024-04-12 20:53 UTC (permalink / raw)
  To: Zhiguo Niu
  Cc: ke.wang, linux-kernel, linux-f2fs-devel, hongyu.jin, Zhiguo Niu

On 04/10, Zhiguo Niu wrote:
> Hi Jaegeuk
> Any comments about this patch?

Thank you for heads up. Applied.

> thanks!
> 
> On Wed, Mar 20, 2024 at 5:33 PM Chao Yu <chao@kernel.org> wrote:
> >
> > On 2024/3/20 14:22, Zhiguo Niu wrote:
> > > some user behaviors requested filesystem operations, which
> > > will cause filesystem not idle.
> > > Meanwhile adjust some f2fs_update_time(REQ_TIME) positions.
> > >
> > > Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> >
> > Reviewed-by: Chao Yu <chao@kernel.org>
> >
> > Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors
  2024-03-20  6:22 [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors Zhiguo Niu
  2024-03-20  9:33 ` Chao Yu
@ 2024-04-14 15:32 ` patchwork-bot+f2fs
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+f2fs @ 2024-04-14 15:32 UTC (permalink / raw)
  To: Zhiguo Niu; +Cc: ke.wang, linux-kernel, linux-f2fs-devel, hongyu.jin, jaegeuk

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Wed, 20 Mar 2024 14:22:16 +0800 you wrote:
> some user behaviors requested filesystem operations, which
> will cause filesystem not idle.
> Meanwhile adjust some f2fs_update_time(REQ_TIME) positions.
> 
> Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> ---
> v3: modify some update conditions according to Chao's suggeestions
> v2: update patch according to Chao's suggestions
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,V3] f2fs: add REQ_TIME time update for some user behaviors
    https://git.kernel.org/jaegeuk/f2fs/c/fa18d87cb20f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2024-04-14 15:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20  6:22 [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors Zhiguo Niu
2024-03-20  9:33 ` Chao Yu
2024-04-10  7:19   ` Zhiguo Niu
2024-04-12 20:53     ` Jaegeuk Kim
2024-04-14 15:32 ` patchwork-bot+f2fs

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).