[PATCH] ovl: skip ovl_file_modified() for dedupe operations

cuitao <[email protected]>
Newsgroups org.kernel.vger.linux-unionfs
Message-ID <[email protected]>
DEDUPE only compares data blocks between two files without modifying
file_out, so there is no need to call ovl_file_modified() to sync
attributes from the real inode. This aligns with the existing
guard at the top of ovl_copyfile() which already skips copyattr
and file_remove_privs for OVL_DEDUPE.

Signed-off-by: cuitao <[email protected]>
---
 fs/overlayfs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
index 27cc07738f33..f1829f425f45 100644
--- a/fs/overlayfs/file.c
+++ b/fs/overlayfs/file.c
@@ -572,7 +572,8 @@ static loff_t ovl_copyfile(struct file *file_in, loff_t pos_in,
 	}
 
 	/* Update size */
-	ovl_file_modified(file_out);
+	if (op != OVL_DEDUPE)
+		ovl_file_modified(file_out);
 
 out_unlock:
 	inode_unlock(inode_out);
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.