On Wed, Jan 20, 2021 at 07:44:00PM +0100, Christoph Hellwig wrote: > [another full quote removed, guys please send properly formatted email] > > On Wed, Jan 20, 2021 at 10:40:56AM -0800, Darrick J. Wong wrote: > > > + if (!(flags & IOMAP_DIO_UNALIGNED)) > > > + inode_dio_wait(VFS_I(ip)); > > > > Er... this really confused me when I read it -- my first thought was > > "How can we be in the unaligned direct write function but DIO_UNALIGNED > > isn't set? Wouldn't we be in some other function if we're doing an > > aligned direct write?" > > > > Then I looked upthread to where Christph said he'd renamed it > > IOMAP_DIO_SUBBLOCK, but I didn't think that was sufficiently better: > > > > if (!(flags & IOMAP_DIO_SUBBLOCK)) > > iomap_dio_wait(...); > > > > This flag doesn't have a 1:1 relationship with the iocb asking for an > > (fsblock-)unaligned write or the iocb saying that the write involves > > sub-block io -- this flag really means "I require a stable written > > mapping, no post-processing (of the disk block) allowed". > > Would: > > if (flags & IOMAP_DIO_FORCE_WAIT) > inode_dio_wait(VFS_I(ip)); > > look any better to you? Behavior would be the same. Looks fine to me. --D