[Concept,04/14] linux: ext4l: Skip orphan handling in U-Boot

Message ID 20251230205157.3383926-5-sjg@u-boot.org
State New
Headers
Series ext4l: Linux adaptation patches for ext4 write support |

Commit Message

Simon Glass Dec. 30, 2025, 8:51 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Skip orphan handling in U-Boot. We do synchronous journal commits
after each operation, so orphan recovery is not needed. Adding to
the orphan list without proper locking can corrupt the list.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/orphan.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/fs/ext4l/orphan.c b/fs/ext4l/orphan.c
index 32ec59b2978..b142c1bd21f 100644
--- a/fs/ext4l/orphan.c
+++ b/fs/ext4l/orphan.c
@@ -103,6 +103,15 @@  int ext4_orphan_add(handle_t *handle, struct inode *inode)
 	int err = 0, rc;
 	bool dirty = false;
 
+#ifdef __UBOOT__
+	/*
+	 * Skip orphan handling in U-Boot. We do synchronous journal commits
+	 * after each operation, so orphan recovery is not needed. Adding to
+	 * the orphan list without proper locking can corrupt the list.
+	 */
+	return 0;
+#endif
+
 	if (!sbi->s_journal || is_bad_inode(inode))
 		return 0;