On Tue, Aug 12, 2025 at 03:32:01AM +0000, Rajeev Mishra wrote: > Hi Kuai, > > Thank you for the feedback on the v2 patch regarding error handling. > > Yu mentioned: > > return 0 here is odd. Why not "return ret;" to propagate the error if any ? > > I understand the concern about proper error propagation. However, there's a > type compatibility issue I'd like to discuss before implementing v3: > > 1. Current function signature: `static loff_t get_size(...)` > - Returns size as positive loff_t (unsigned 64-bit) > - All callers expect non-negative size values > > 2. vfs_getattr_nosec() error codes are negative integers (-ENOENT, -EIO, etc.) > - Returning `ret` would cast negative errors to huge positive numbers Huh? loff_t is signed; had always been that way... > 3. Current callers like loop_set_size() don't handle error checking If you start returning errors, they ought to. Incidentally, it might make sense to return the size in bytes - just move the shift into loop_set_size()...