On Thu, Aug 8, 2024 at 1:55 AM Wang Yugui <wangyugui@xxxxxxxxxxxx> wrote: > > Hi, > > > From: Filipe Manana <fdmanana@xxxxxxxx> > > > > commit 939b656bc8ab203fdbde26ccac22bcb7f0985be5 upstream. > > > > During an append (O_APPEND write flag) direct IO write if the input buffer > > was not previously faulted in, we can corrupt the file in a way that the > > final size is unexpected and it includes an unexpected hole. > > Could we apply the patch > 70f1e5b6db56ae99ede369d25d5996fa50d7bb74 > btrfs: rename err to ret in btrfs_direct_write() > to 6.6 stable, and then rebase this patch? Why? Generally we don't backport cleanups and refactorings, only bug fixes. Adding that patch wouldn't make the backport easier, that is, we still couldn't pick the commit from Linus' master branch without any changes, because at least the commit would fail to apply due to the move of the direct IO code into a new file, and possibly other changes too. > > Best Regards > Wang Yugui (wangyugui@xxxxxxxxxxxx) > 2024/08/08 > >