Skip to contentSkip to conversation

nilfs2-do-not-propagate-enoent-error-from-sufile-during-recovery.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Sep 2, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: nilfs2: do not propagate ENOENT error from sufile during recovery
has been removed from the -mm tree. Its filename was
nilfs2-do-not-propagate-enoent-error-from-sufile-during-recovery.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Ryusuke Konishi <[email protected]>
Subject: nilfs2: do not propagate ENOENT error from sufile during recovery
Date: Thu, 22 Aug 2024 00:46:25 +0900

nilfs_sufile_free() returns the error code -ENOENT when the block where the segment usage should be placed does not exist (hole block case), but this error should not be propagated upwards to the mount system call.

In nilfs_prepare_segment_for_recovery(), one of the recovery steps during mount, nilfs_sufile_free() is used and may return -ENOENT as is, so in that case return -EINVAL instead.

---

 fs/nilfs2/recovery.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
fs/nilfs2/recovery.c renamed from fs/nilfs2/recovery.c~nilfs2-do-not-propagate-enoent-error-from-sufile-during-recovery +10 -1
@@ -433,8 +433,17 @@ static int nilfs_prepare_segment_for_rec
 	 * The next segment is invalidated by this recovery.
 	 */
 	err = nilfs_sufile_free(sufile, segnum[1]);
-	if (unlikely(err))
+	if (unlikely(err)) {
+		if (err == -ENOENT) {
+			nilfs_err(sb,
+				  "checkpoint log inconsistency at block %llu (segment %llu): next segment %llu is unallocated",
+				  (unsigned long long)nilfs->ns_last_pseg,
+				  (unsigned long long)nilfs->ns_segnum,
+				  (unsigned long long)segnum[1]);
+			err = -EINVAL;
+		}
 		goto failed;
+	}
 
 	for (i = 1; i < 4; i++) {
 		err = nilfs_segment_list_add(head, segnum[i]);

_

Patches currently in -mm which might be from [email protected] are