hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/fs/nilfs2/btree.c
....@@ -480,9 +480,18 @@
480480 ret = nilfs_btnode_submit_block(btnc, ptr, 0, REQ_OP_READ, 0, &bh,
481481 &submit_ptr);
482482 if (ret) {
483
- if (ret != -EEXIST)
484
- return ret;
485
- goto out_check;
483
+ if (likely(ret == -EEXIST))
484
+ goto out_check;
485
+ if (ret == -ENOENT) {
486
+ /*
487
+ * Block address translation failed due to invalid
488
+ * value of 'ptr'. In this case, return internal code
489
+ * -EINVAL (broken bmap) to notify bmap layer of fatal
490
+ * metadata corruption.
491
+ */
492
+ ret = -EINVAL;
493
+ }
494
+ return ret;
486495 }
487496
488497 if (ra) {