On 11/12/2024 08:53, Christoph Hellwig wrote:
+ if (is_append) { + struct queue_limits *lim = bdev_limits(bio->bi_bdev); + + sector_offset = bio_split_rw_at(bio, lim, &nr_segs, + min(lim->max_zone_append_sectors << SECTOR_SHIFT, + *alloc_len)); + if (!sector_offset)
Should this be: if (sector_offset <= 0)
+ return NULL; + } else { + if (bio->bi_iter.bi_size <= *alloc_len) + return NULL; + sector_offset = *alloc_len >> SECTOR_SHIFT; + } + + /* ensure the split ioend is still block size aligned */ + sector_offset = ALIGN_DOWN(sector_offset << SECTOR_SHIFT, + i_blocksize(ioend->io_inode)) >> SECTOR_SHIFT;