hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/ext4/extents.c
....@@ -4694,7 +4694,6 @@
46944694 FALLOC_FL_INSERT_RANGE))
46954695 return -EOPNOTSUPP;
46964696
4697
- ext4_fc_start_update(inode);
46984697 inode_lock(inode);
46994698 ret = ext4_convert_inline_data(inode);
47004699 inode_unlock(inode);
....@@ -4764,7 +4763,6 @@
47644763 inode_unlock(inode);
47654764 trace_ext4_fallocate_exit(inode, offset, max_blocks, ret);
47664765 exit:
4767
- ext4_fc_stop_update(inode);
47684766 return ret;
47694767 }
47704768
....@@ -5802,6 +5800,15 @@
58025800 struct ext4_extent *extent;
58035801 ext4_lblk_t first_lblk, first_lclu, last_lclu;
58045802
5803
+ /*
5804
+ * if data can be stored inline, the logical cluster isn't
5805
+ * mapped - no physical clusters have been allocated, and the
5806
+ * file has no extents
5807
+ */
5808
+ if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) ||
5809
+ ext4_has_inline_data(inode))
5810
+ return 0;
5811
+
58055812 /* search for the extent closest to the first block in the cluster */
58065813 path = ext4_find_extent(inode, EXT4_C2B(sbi, lclu), NULL, 0);
58075814 if (IS_ERR(path)) {