From 3943b53fd110ff0cd03cec4b28a36b0eb410e0be Mon Sep 17 00:00:00 2001 From: Paul Wedeck Date: Wed, 11 Oct 2023 16:10:53 +0200 Subject: [PATCH] only "truncate" a file during recovery if this operation makes sense (fix #22) --- Linux-5.1/fs/winefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Linux-5.1/fs/winefs/super.c b/Linux-5.1/fs/winefs/super.c index acf0905c9..1599ec1fd 100644 --- a/Linux-5.1/fs/winefs/super.c +++ b/Linux-5.1/fs/winefs/super.c @@ -707,7 +707,7 @@ static void pmfs_recover_truncate_list(struct super_block *sb) break; pmfs_dbg("Recover ino %llx nlink %d sz %llx:%llx\n", ino_next, inode->i_nlink, pi->i_size, li->i_truncatesize); - if (inode->i_nlink) { + if (inode->i_nlink && le64_to_cpu(li->i_truncatesize) != inode->i_size) { /* set allocation hint */ /*pmfs_set_blocksize_hint(sb, pi, le64_to_cpu(li->i_truncatesize));