Re: [PATCH 11/17] iomap: assign current->backing_dev_info in iomap_file_buffered_write

From: Christoph Hellwig
Date: Mon Apr 24 2023 - 02:22:28 EST


On Sun, Apr 23, 2023 at 11:18:25PM -0700, Darrick J. Wong wrote:
> > @@ -876,8 +877,11 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
> > if (iocb->ki_flags & IOCB_NOWAIT)
> > iter.flags |= IOMAP_NOWAIT;
> >
> > + current->backing_dev_info = inode_to_bdi(iter.inode);
>
> Dumb question from me late on a Sunday night, but does the iomap_unshare
> code need to set this too? Since it works by dirtying pagecache folios
> without actually changing the contents?

A very good question that I have no answer for. The
current->backing_dev_info mechanism confuses the heck out of me and
appears basically undocumented.