All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-nonmm-stable] fat-restore-original-value-when-fat_ent_write-failed.patch removed from -mm tree
@ 2026-08-04  4:04 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-04  4:04 UTC (permalink / raw)
  To: mm-commits, yuantan098, yifanwucs, tomapufckgml, stable, n05ec,
	hirofumi, brauner, bird, prcups, akpm


The quilt patch titled
     Subject: fat: restore original value when fat_ent_write failed
has been removed from the -mm tree.  Its filename was
     fat-restore-original-value-when-fat_ent_write-failed.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: Yemu Lu <prcups@krgm.moe>
Subject: fat: restore original value when fat_ent_write failed
Date: Mon, 25 May 2026 16:56:49 +0800

fat_ent_write() may have committed the new link to the primary FAT but
then failed on the mirror copy, leaving the chain pointing to new_dclus
even though the caller will free it.  Restore the original value to keep
the chain consistent.

Link: https://lore.kernel.org/20260525085649.781643-1-n05ec@lzu.edu.cn
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yemu Lu <prcups@krgm.moe>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Christian Brauner <brauner@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/fat/misc.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/fs/fat/misc.c~fat-restore-original-value-when-fat_ent_write-failed
+++ a/fs/fat/misc.c
@@ -133,7 +133,11 @@ int fat_chain_add(struct inode *inode, i
 		ret = fat_ent_read(inode, &fatent, last);
 		if (ret >= 0) {
 			int wait = inode_needs_sync(inode);
+			int old = ret;
+
 			ret = fat_ent_write(inode, &fatent, new_dclus, wait);
+			if (ret < 0)
+				fat_ent_write(inode, &fatent, old, wait);
 			fatent_brelse(&fatent);
 		}
 		if (ret < 0)
_

Patches currently in -mm which might be from prcups@krgm.moe are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-04  4:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04  4:04 [merged mm-nonmm-stable] fat-restore-original-value-when-fat_ent_write-failed.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.