Skip to content

Commit 2d1b3bb

Browse files
axboebrauner
authored andcommitted
ovl: disable IOCB_DIO_CALLER_COMP
overlayfs copies the kiocb flags when it sets up a new kiocb to handle a write, but it doesn't properly support dealing with the deferred caller completions of the kiocb. This means it doesn't get the final write completion value, and hence will complete the write with '0' as the result. We could support the caller completions in overlayfs, but for now let's just disable them in the generated write kiocb. Reported-by: Zorro Lang <zlang@redhat.com> Link: https://lore.kernel.org/io-uring/20230924142754.ejwsjen5pvyc32l4@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com/ Fixes: 8c052fb ("iomap: support IOCB_DIO_CALLER_COMP") Signed-off-by: Jens Axboe <axboe@kernel.dk> Message-Id: <71897125-e570-46ce-946a-d4729725e28f@kernel.dk> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 060e6c7 commit 2d1b3bb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

fs/overlayfs/file.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
393393
if (!ovl_should_sync(OVL_FS(inode->i_sb)))
394394
ifl &= ~(IOCB_DSYNC | IOCB_SYNC);
395395

396+
/*
397+
* Overlayfs doesn't support deferred completions, don't copy
398+
* this property in case it is set by the issuer.
399+
*/
400+
ifl &= ~IOCB_DIO_CALLER_COMP;
401+
396402
old_cred = ovl_override_creds(file_inode(file)->i_sb);
397403
if (is_sync_kiocb(iocb)) {
398404
file_start_write(real.file);

0 commit comments

Comments
 (0)