[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZLAZn_SBmoIFG5F5@yuki>
Date: Thu, 13 Jul 2023 17:34:55 +0200
From: Cyril Hrubis <chrubis@...e.cz>
To: Christoph Hellwig <hch@....de>
Cc: kernel test robot <oliver.sang@...el.com>,
"Darrick J. Wong" <djwong@...nel.org>,
Andreas Gruenbacher <agruenba@...hat.com>,
Miklos Szeredi <miklos@...redi.hu>,
Matthew Wilcox <willy@...radead.org>, cluster-devel@...hat.com,
Ilya Dryomov <idryomov@...il.com>,
Miklos Szeredi <mszeredi@...hat.com>,
Chao Yu <chao@...nel.org>, linux-fsdevel@...r.kernel.org,
Al Viro <viro@...iv.linux.org.uk>,
Jaegeuk Kim <jaegeuk@...nel.org>, Xiubo Li <xiubli@...hat.com>,
Trond Myklebust <trond.myklebust@...merspace.com>,
ltp@...ts.linux.it, lkp@...el.com, Jens Axboe <axboe@...nel.dk>,
Christian Brauner <brauner@...nel.org>,
Theodore Ts'o <tytso@....edu>,
Johannes Thumshirn <johannes.thumshirn@....com>,
linux-kernel@...r.kernel.org, linux-xfs@...r.kernel.org,
Anna Schumaker <anna@...nel.org>, oe-lkp@...ts.linux.dev,
Andrew Morton <akpm@...ux-foundation.org>,
Hannes Reinecke <hare@...e.de>
Subject: Re: [LTP] [linus:master] [iomap] 219580eea1: ltp.writev07.fail
Hi!
> I can't reproduce this on current mainline. Is this a robust failure
> or flapping test? Especiall as the FAIL conditions look rather
> unrelated.
Actually the test is spot on, the difference is that previously the
error was returned form the iomap_file_buffered_write() only if we
failed with the first buffer from the iov, now we always return the
error and we do not advance the offset.
The change that broke it:
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 063133ec77f4..550525a525c4 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -864,16 +864,19 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
.len = iov_iter_count(i),
.flags = IOMAP_WRITE,
};
- int ret;
+ ssize_t ret;
if (iocb->ki_flags & IOCB_NOWAIT)
iter.flags |= IOMAP_NOWAIT;
while ((ret = iomap_iter(&iter, ops)) > 0)
iter.processed = iomap_write_iter(&iter, i);
- if (iter.pos == iocb->ki_pos)
+
+ if (unlikely(ret < 0))
return ret;
- return iter.pos - iocb->ki_pos;
+ ret = iter.pos - iocb->ki_pos;
+ iocb->ki_pos += ret;
+ return ret;
}
I suppose that we shoudl fix is with something as:
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index adb92cdb24b0..bfb39f7bc303 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -872,11 +872,12 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
while ((ret = iomap_iter(&iter, ops)) > 0)
iter.processed = iomap_write_iter(&iter, i);
+ iocb->ki_pos += iter.pos - iocb->ki_pos;
+
if (unlikely(ret < 0))
return ret;
- ret = iter.pos - iocb->ki_pos;
- iocb->ki_pos += ret;
- return ret;
+
+ return iter.pos - iocb->ki_pos;
}
EXPORT_SYMBOL_GPL(iomap_file_buffered_write);
--
Cyril Hrubis
chrubis@...e.cz
Powered by blists - more mailing lists