ext4: brelse all indirect buffer in ext4_ind_remove_space()
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / fs / ext4 / indirect.c
index bf7fa1507e811221523a785cee1ed41159d7a0ca..9e96a0bd08d9c8e71b85a2ce459715ccd5c701c6 100644 (file)
@@ -1387,10 +1387,14 @@ end_range:
                                           partial->p + 1,
                                           partial2->p,
                                           (chain+n-1) - partial);
-                       BUFFER_TRACE(partial->bh, "call brelse");
-                       brelse(partial->bh);
-                       BUFFER_TRACE(partial2->bh, "call brelse");
-                       brelse(partial2->bh);
+                       while (partial > chain) {
+                               BUFFER_TRACE(partial->bh, "call brelse");
+                               brelse(partial->bh);
+                       }
+                       while (partial2 > chain2) {
+                               BUFFER_TRACE(partial2->bh, "call brelse");
+                               brelse(partial2->bh);
+                       }
                        return 0;
                }