VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Hugh Dickins <hughd@google.com> 2021-05-04 18:32:57 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-05-05 11:27:20 -0700 commit: 786b31121a2ce4309a81a7f36d63f02ca588839e parent: 8bc3c481b3d0dcef2cf8e1b7c6b780af6725f7e3
Commit Summary:
mm: remove nrexceptional from inode: remove BUG_ON
Diffstat:
1 file changed, 8 insertions, 1 deletion
diff --git a/fs/inode.c b/fs/inode.c
index af48d1b722f0..c93500d84264 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -529,7 +529,14 @@ void clear_inode(struct inode *inode)
 	 */
 	xa_lock_irq(&inode->i_data.i_pages);
 	BUG_ON(inode->i_data.nrpages);
-	BUG_ON(!mapping_empty(&inode->i_data));
+	/*
+	 * Almost always, mapping_empty(&inode->i_data) here; but there are
+	 * two known and long-standing ways in which nodes may get left behind
+	 * (when deep radix-tree node allocation failed partway; or when THP
+	 * collapse_file() failed). Until those two known cases are cleaned up,
+	 * or a cleanup function is called here, do not BUG_ON(!mapping_empty),
+	 * nor even WARN_ON(!mapping_empty).
+	 */
 	xa_unlock_irq(&inode->i_data.i_pages);
 	BUG_ON(!list_empty(&inode->i_data.private_list));
 	BUG_ON(!(inode->i_state & I_FREEING));