On Sat, Feb 13, 2021 at 1:07 AM Wang Yugui <wangyu...@e16-tech.com> wrote: > > Hi, > > > This bug only affects 5.10 kernels, and the regression was introduced in > > 5.10-rc1 by commit 0eb79294dbe328 ("btrfs: dio iomap DSYNC workaround"). > > The bug does not exist in 5.11 kernels due to commit ecfdc08b8cc65d > > ("btrfs: remove dio iomap DSYNC workaround"), which depends on other > > changes that went into the merge window for 5.11. So this is a fix only > > for 5.10.x stable kernels, as there are people hitting this. > > It is OK too to backport commit ecfdc08b8cc65d > ("btrfs: remove dio iomap DSYNC workaround") to 5.10 for this problem? > > the iomap issue for commit 0eb79294dbe328 ("btrfs: dio iomap DSYNC > workaround") > is already fixed in 5.10?
Quoting the changelog: "commit ecfdc08b8cc65d ("btrfs: remove dio iomap DSYNC workaround"), which depends on other changes that went into the merge window for 5.11." All the changes, are (at least): commit ecfdc08b8cc65d737eebc26a1ee1875a097fd6a0 --> 5.11-rc1 Author: Goldwyn Rodrigues <rgold...@suse.com> Date: Thu Sep 24 11:39:21 2020 -0500 btrfs: remove dio iomap DSYNC workaround commit a42fa643169d2325602572633fcaa16862990e28 Author: Goldwyn Rodrigues <rgold...@suse.com> Date: Thu Sep 24 11:39:20 2020 -0500 btrfs: call iomap_dio_complete() without inode_lock commit 502756b380938022c848761837f8fa3976906aa1 Author: Goldwyn Rodrigues <rgold...@suse.com> Date: Thu Sep 24 11:39:19 2020 -0500 btrfs: remove btrfs_inode::dio_sem commit e9adabb9712ef9424cbbeeaa027d962ab5262e19 Author: Goldwyn Rodrigues <rgold...@suse.com> Date: Thu Sep 24 11:39:18 2020 -0500 btrfs: use shared lock for direct writes within EOF commit c352370633400d13765cc88080c969799ea51108 Author: Goldwyn Rodrigues <rgold...@suse.com> Date: Thu Sep 24 11:39:17 2020 -0500 btrfs: push inode locking and unlocking into buffered/direct write commit a14b78ad06aba0fa7e76d2bc13c5ba581a7f331a Author: Goldwyn Rodrigues <rgold...@suse.com> Date: Thu Sep 24 11:39:16 2020 -0500 btrfs: introduce btrfs_inode_lock()/unlock() commit b8d8e1fd570a194904f545b135efc880d96a41a4 Author: Goldwyn Rodrigues <rgold...@suse.com> Date: Thu Sep 24 11:39:15 2020 -0500 btrfs: introduce btrfs_write_check() That's probably too much to add to stable at once, plus I'm assuming all required iomap dependencies are in 5.10 already (it seems so, unless I missed something). Usually we don't add patches to stable that didn't go through Linus' tree either (there were 1 or 2 very rare exceptions in the past I think), but when a backport depends on so many patches, and not all from the same patchset, the risk of getting something wrong is significant. That's why I opted to send this patch, which is much more simple. David has more experience on that and it's up to him to decide. > > Best Regards > Wang Yugui (wangyu...@e16-tech.com) > 2021/02/13 > > > > Fixes: 0eb79294dbe328 ("btrfs: dio iomap DSYNC workaround") > > CC: sta...@vger.kernel.org # 5.10 (and only 5.10) > > Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1181605 > > Signed-off-by: Filipe Manana <fdman...@suse.com> > > --- > > fs/btrfs/inode.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > > index acc47e2ffb46..b536d21541a9 100644 > > --- a/fs/btrfs/inode.c > > +++ b/fs/btrfs/inode.c > > @@ -8026,8 +8026,12 @@ ssize_t btrfs_direct_IO(struct kiocb *iocb, struct > > iov_iter *iter) > > bool relock = false; > > ssize_t ret; > > > > - if (check_direct_IO(fs_info, iter, offset)) > > + if (check_direct_IO(fs_info, iter, offset)) { > > + ASSERT(current->journal_info == NULL || > > + current->journal_info == BTRFS_DIO_SYNC_STUB); > > + current->journal_info = NULL; > > return 0; > > + } > > > > count = iov_iter_count(iter); > > if (iov_iter_rw(iter) == WRITE) { > > -- > > 2.28.0 > >