On Mon, Jan 11, 2021 at 12:58:11PM +0200, Nikolay Borisov wrote: > It's currently u64 which gets instantly translated either to LONG_MAX > (if U64_MAX is passed) or casted to an unsigned long (which is in fact, > wrong because iwriteback_control::nr_to_write is a signed, long type). > > Just convert the function's argument to be long time which obviates the > need to manually convert u64 value to a long. Adjust all call sites > which pass U64_MAX to pass LONG_MAX. Finally ensure that in > shrink_delalloc the u64 is converted to a long without overflowing, > resulting in a negative number. > > Signed-off-by: Nikolay Borisov <[email protected]> > --- > David, > > Here are 2 patches which I believe should be folded into > "btrfs: shrink delalloc pages instead of full inodes"
That patch is about to be merged to Linus' tree so I'll apply your patches separately.
