hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/fs/nilfs2/btnode.c
....@@ -285,6 +285,14 @@
285285 if (nbh == NULL) { /* blocksize == pagesize */
286286 xa_erase_irq(&btnc->i_pages, newkey);
287287 unlock_page(ctxt->bh->b_page);
288
- } else
289
- brelse(nbh);
288
+ } else {
289
+ /*
290
+ * When canceling a buffer that a prepare operation has
291
+ * allocated to copy a node block to another location, use
292
+ * nilfs_btnode_delete() to initialize and release the buffer
293
+ * so that the buffer flags will not be in an inconsistent
294
+ * state when it is reallocated.
295
+ */
296
+ nilfs_btnode_delete(nbh);
297
+ }
290298 }