Hi all,
Today's linux-next merge of the akpm-current tree got a conflict in:
fs/btrfs/file.c
between commit:
0225a20db6d8 ("btrfs: Prevent nowait or async read from doing sync IO")
from the btrfs tree and commit:
ddcd14c48a30 ("mm/filemap: rename generic_file_buffered_read to filemap_read")
from the akpm-current tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc fs/btrfs/file.c
index 5282f456c99c,898ef7b792b7..000000000000
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@@ -3629,18 -3639,7 +3629,18 @@@ static ssize_t btrfs_file_read_iter(str
return ret;
}
- return filemap_read(iocb, to, ret);
+ if (iocb->ki_flags & IOCB_NOWAIT)
+ iocb->ki_flags |= IOCB_NOIO;
+
- ret = generic_file_buffered_read(iocb, to, ret);
++ ret = filemap_read(iocb, to, ret);
+
+ if (iocb->ki_flags & IOCB_NOWAIT) {
+ iocb->ki_flags &= ~IOCB_NOIO;
+ if (ret == 0)
+ ret = -EAGAIN;
+ }
+
+ return ret;
}
const struct file_operations btrfs_file_operations = {
Hi all,
On Wed, 27 Jan 2021 22:39:18 +1100 Stephen Rothwell <[email protected]> wrote:
>
> Today's linux-next merge of the akpm-current tree got a conflict in:
>
> fs/btrfs/file.c
>
> between commit:
>
> 0225a20db6d8 ("btrfs: Prevent nowait or async read from doing sync IO")
>
> from the btrfs tree and commit:
>
> ddcd14c48a30 ("mm/filemap: rename generic_file_buffered_read to filemap_read")
>
> from the akpm-current tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc fs/btrfs/file.c
> index 5282f456c99c,898ef7b792b7..000000000000
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@@ -3629,18 -3639,7 +3629,18 @@@ static ssize_t btrfs_file_read_iter(str
> return ret;
> }
>
> - return filemap_read(iocb, to, ret);
> + if (iocb->ki_flags & IOCB_NOWAIT)
> + iocb->ki_flags |= IOCB_NOIO;
> +
> - ret = generic_file_buffered_read(iocb, to, ret);
> ++ ret = filemap_read(iocb, to, ret);
> +
> + if (iocb->ki_flags & IOCB_NOWAIT) {
> + iocb->ki_flags &= ~IOCB_NOIO;
> + if (ret == 0)
> + ret = -EAGAIN;
> + }
> +
> + return ret;
> }
>
> const struct file_operations btrfs_file_operations = {
With the merge window about to open, this is a reminder that this
conflict still exists.
The btrfs tree commit is now
1605f1b63c76 ("btrfs: Prevent nowait or async read from doing sync IO")
The akpm-current commit is now
de45c82ebea8 ("mm/filemap: rename generic_file_buffered_read to filemap_read")
--
Cheers,
Stephen Rothwell
Hi all,
On Mon, 15 Feb 2021 08:46:34 +1100 Stephen Rothwell <[email protected]> wrote:
>
> On Wed, 27 Jan 2021 22:39:18 +1100 Stephen Rothwell <[email protected]> wrote:
> >
> > Today's linux-next merge of the akpm-current tree got a conflict in:
> >
> > fs/btrfs/file.c
> >
> > between commit:
> >
> > 0225a20db6d8 ("btrfs: Prevent nowait or async read from doing sync IO")
> >
> > from the btrfs tree and commit:
> >
> > ddcd14c48a30 ("mm/filemap: rename generic_file_buffered_read to filemap_read")
> >
> > from the akpm-current tree.
> >
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging. You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.
> >
> > diff --cc fs/btrfs/file.c
> > index 5282f456c99c,898ef7b792b7..000000000000
> > --- a/fs/btrfs/file.c
> > +++ b/fs/btrfs/file.c
> > @@@ -3629,18 -3639,7 +3629,18 @@@ static ssize_t btrfs_file_read_iter(str
> > return ret;
> > }
> >
> > - return filemap_read(iocb, to, ret);
> > + if (iocb->ki_flags & IOCB_NOWAIT)
> > + iocb->ki_flags |= IOCB_NOIO;
> > +
> > - ret = generic_file_buffered_read(iocb, to, ret);
> > ++ ret = filemap_read(iocb, to, ret);
> > +
> > + if (iocb->ki_flags & IOCB_NOWAIT) {
> > + iocb->ki_flags &= ~IOCB_NOIO;
> > + if (ret == 0)
> > + ret = -EAGAIN;
> > + }
> > +
> > + return ret;
> > }
> >
> > const struct file_operations btrfs_file_operations = {
>
> With the merge window about to open, this is a reminder that this
> conflict still exists.
>
> The btrfs tree commit is now
>
> 1605f1b63c76 ("btrfs: Prevent nowait or async read from doing sync IO")
Now
5b1c5c4216f2 ("btrfs: Prevent nowait or async read from doing sync IO")
> The akpm-current commit is now
>
> de45c82ebea8 ("mm/filemap: rename generic_file_buffered_read to filemap_read")
Now in Linus' tree as
87fa0f3eb267 ("mm/filemap: rename generic_file_buffered_read to filemap_read")
This ia now a conflict between the btrfs tree and Linus' tree.
--
Cheers,
Stephen Rothwell
On Fri, Feb 26, 2021 at 10:32:50AM +1100, Stephen Rothwell wrote:
> > > - return filemap_read(iocb, to, ret);
> > > + if (iocb->ki_flags & IOCB_NOWAIT)
> > > + iocb->ki_flags |= IOCB_NOIO;
> > > +
> > > - ret = generic_file_buffered_read(iocb, to, ret);
> > > ++ ret = filemap_read(iocb, to, ret);
> > > +
> > > + if (iocb->ki_flags & IOCB_NOWAIT) {
> > > + iocb->ki_flags &= ~IOCB_NOIO;
> > > + if (ret == 0)
> > > + ret = -EAGAIN;
> > > + }
> > > +
> > > + return ret;
> > > }
I think the above code looks completely bogus. Instead whatever code
in btrfs hecks for IOCB_NOIO to avoid blocking readahead should also
check IOCB_NOWAIT.
On Fri, Feb 26, 2021 at 06:16:26AM +0100, Christoph Hellwig wrote:
> On Fri, Feb 26, 2021 at 10:32:50AM +1100, Stephen Rothwell wrote:
> > > > - return filemap_read(iocb, to, ret);
> > > > + if (iocb->ki_flags & IOCB_NOWAIT)
> > > > + iocb->ki_flags |= IOCB_NOIO;
> > > > +
> > > > - ret = generic_file_buffered_read(iocb, to, ret);
> > > > ++ ret = filemap_read(iocb, to, ret);
> > > > +
> > > > + if (iocb->ki_flags & IOCB_NOWAIT) {
> > > > + iocb->ki_flags &= ~IOCB_NOIO;
> > > > + if (ret == 0)
> > > > + ret = -EAGAIN;
> > > > + }
> > > > +
> > > > + return ret;
> > > > }
>
> I think the above code looks completely bogus. Instead whatever code
> in btrfs hecks for IOCB_NOIO to avoid blocking readahead should also
> check IOCB_NOWAIT.
Thanks for the comment, I've removed the patch from for-next and
notified the authors.