Message ID | 22bfc4e3494ceb700ff324f8ff821d6cff5490f7.1679042083.git.ojaswin@linux.ibm.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
Series | ext4: Convert inode preallocation list to an rbtree | expand |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 63a68cee36c6..ed58cefed7fa 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4379,8 +4379,13 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac) /* non-extent files can't have physical blocks past 2^32 */ if (!(ext4_test_inode_flag(ac->ac_inode, EXT4_INODE_EXTENTS)) && (pa->pa_pstart + EXT4_C2B(sbi, pa->pa_len) > - EXT4_MAX_BLOCK_FILE_PHYS)) - continue; + EXT4_MAX_BLOCK_FILE_PHYS)) { + /* + * Since PAs don't overlap, we won't find any + * other PA to satisfy this. + */ + break; + } /* found preallocated blocks, use them */ spin_lock(&pa->pa_lock);