On Mon, Nov 1, 2021 at 4:20 PM Jens Axboe <axboe@xxxxxxxxx> wrote: > > Yes, probably safer just to make bdev_nr_bytes() return sector_t as > well, even if loff_t isn't strictly wrong. Well, that would actually change the sign of some of the existing comparisons. Possibly changing their meaning entirely.. So having 'loff_t' being signed may be an odd choice for a byte size, but it is what it is. At least the current set of cleanups seemed to keep the type logic the same when it changed i_size_read() to be bdev_nr_bytes() instead. Changing it to 'sector_t' not only doesn't make conceptual sense when it's a byte count, it might also be dangerous. So my reaction was really that it wasn't obvious that bdev_nr_bytes() did the shift in the right type.. It does happen to do that, but historically sector_t was the smaller type. Linus