@@ -2375,13 +2375,14 @@ static bool uuid_is_nonzero(__u8 u[16])
23752375static int f2fs_ioc_set_encryption_policy (struct file * filp , unsigned long arg )
23762376{
23772377 struct inode * inode = file_inode (filp );
2378+ int ret ;
23782379
23792380 if (!f2fs_sb_has_encrypt (F2FS_I_SB (inode )))
23802381 return - EOPNOTSUPP ;
23812382
2383+ ret = fscrypt_ioctl_set_policy (filp , (const void __user * )arg );
23822384 f2fs_update_time (F2FS_I_SB (inode ), REQ_TIME );
2383-
2384- return fscrypt_ioctl_set_policy (filp , (const void __user * )arg );
2385+ return ret ;
23852386}
23862387
23872388static int f2fs_ioc_get_encryption_policy (struct file * filp , unsigned long arg )
@@ -2809,7 +2810,8 @@ static int f2fs_ioc_defragment(struct file *filp, unsigned long arg)
28092810 err = f2fs_defragment_range (sbi , filp , & range );
28102811 mnt_drop_write_file (filp );
28112812
2812- f2fs_update_time (sbi , REQ_TIME );
2813+ if (range .len )
2814+ f2fs_update_time (sbi , REQ_TIME );
28132815 if (err < 0 )
28142816 return err ;
28152817
@@ -3622,6 +3624,8 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
36223624 filemap_invalidate_unlock (inode -> i_mapping );
36233625 f2fs_up_write (& F2FS_I (inode )-> i_gc_rwsem [WRITE ]);
36243626out :
3627+ if (released_blocks )
3628+ f2fs_update_time (sbi , REQ_TIME );
36253629 inode_unlock (inode );
36263630
36273631 mnt_drop_write_file (filp );
@@ -3790,6 +3794,8 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
37903794 f2fs_mark_inode_dirty_sync (inode , true);
37913795 }
37923796unlock_inode :
3797+ if (reserved_blocks )
3798+ f2fs_update_time (sbi , REQ_TIME );
37933799 inode_unlock (inode );
37943800 mnt_drop_write_file (filp );
37953801
@@ -3986,6 +3992,7 @@ static int f2fs_sec_trim_file(struct file *filp, unsigned long arg)
39863992 if (len )
39873993 ret = f2fs_secure_erase (prev_bdev , inode , prev_index ,
39883994 prev_block , len , range .flags );
3995+ f2fs_update_time (sbi , REQ_TIME );
39893996out :
39903997 filemap_invalidate_unlock (mapping );
39913998 f2fs_up_write (& F2FS_I (inode )-> i_gc_rwsem [WRITE ]);
@@ -4193,6 +4200,7 @@ static int f2fs_ioc_decompress_file(struct file *filp)
41934200 if (ret )
41944201 f2fs_warn (sbi , "%s: The file might be partially decompressed (errno=%d). Please delete the file." ,
41954202 __func__ , ret );
4203+ f2fs_update_time (sbi , REQ_TIME );
41964204out :
41974205 inode_unlock (inode );
41984206 file_end_write (filp );
@@ -4270,6 +4278,7 @@ static int f2fs_ioc_compress_file(struct file *filp)
42704278 if (ret )
42714279 f2fs_warn (sbi , "%s: The file might be partially compressed (errno=%d). Please delete the file." ,
42724280 __func__ , ret );
4281+ f2fs_update_time (sbi , REQ_TIME );
42734282out :
42744283 inode_unlock (inode );
42754284 file_end_write (filp );
0 commit comments