All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [LTP] [linus:master] [iomap] 219580eea1: ltp.writev07.fail
Date: Thu, 13 Jul 2023 17:34:55 +0200	[thread overview]
Message-ID: <ZLAZn_SBmoIFG5F5@yuki> (raw)
In-Reply-To: <20230713150923.GA28246@lst.de>

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 at suse.cz


WARNING: multiple messages have this Message-ID (diff)
From: Cyril Hrubis <chrubis@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: kernel test robot <oliver.sang@intel.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Matthew Wilcox <willy@infradead.org>,
	cluster-devel@redhat.com, Ilya Dryomov <idryomov@gmail.com>,
	Miklos Szeredi <mszeredi@redhat.com>, Chao Yu <chao@kernel.org>,
	linux-fsdevel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Jaegeuk Kim <jaegeuk@kernel.org>, Xiubo Li <xiubli@redhat.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	ltp@lists.linux.it, lkp@intel.com, Jens Axboe <axboe@kernel.dk>,
	Christian Brauner <brauner@kernel.org>,
	Theodore Ts'o <tytso@mit.edu>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
	Anna Schumaker <anna@kernel.org>,
	oe-lkp@lists.linux.dev, Andrew Morton <akpm@linux-foundation.org>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [LTP] [linus:master] [iomap]  219580eea1: ltp.writev07.fail
Date: Thu, 13 Jul 2023 17:34:55 +0200	[thread overview]
Message-ID: <ZLAZn_SBmoIFG5F5@yuki> (raw)
In-Reply-To: <20230713150923.GA28246@lst.de>

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@suse.cz

WARNING: multiple messages have this Message-ID (diff)
From: Cyril Hrubis <chrubis@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Matthew Wilcox <willy@infradead.org>,
	cluster-devel@redhat.com, Ilya Dryomov <idryomov@gmail.com>,
	Miklos Szeredi <mszeredi@redhat.com>, Chao Yu <chao@kernel.org>,
	oe-lkp@lists.linux.dev, Al Viro <viro@zeniv.linux.org.uk>,
	Jaegeuk Kim <jaegeuk@kernel.org>, Xiubo Li <xiubli@redhat.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	ltp@lists.linux.it, lkp@intel.com, Jens Axboe <axboe@kernel.dk>,
	Christian Brauner <brauner@kernel.org>,
	Theodore Ts'o <tytso@mit.edu>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
	kernel test robot <oliver.sang@intel.com>,
	Anna Schumaker <anna@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [LTP] [linus:master] [iomap]  219580eea1: ltp.writev07.fail
Date: Thu, 13 Jul 2023 17:34:55 +0200	[thread overview]
Message-ID: <ZLAZn_SBmoIFG5F5@yuki> (raw)
In-Reply-To: <20230713150923.GA28246@lst.de>

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@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-07-13 15:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 13:25 [Cluster-devel] [linus:master] [iomap] 219580eea1: ltp.writev07.fail kernel test robot
2023-07-13 13:25 ` kernel test robot
2023-07-13 13:25 ` [LTP] " kernel test robot
2023-07-13 15:09 ` [Cluster-devel] " Christoph Hellwig
2023-07-13 15:09   ` Christoph Hellwig
2023-07-13 15:09   ` [LTP] " Christoph Hellwig
2023-07-13 15:34   ` Cyril Hrubis [this message]
2023-07-13 15:34     ` Cyril Hrubis
2023-07-13 15:34     ` Cyril Hrubis
2023-07-13 15:56     ` [Cluster-devel] " Christoph Hellwig
2023-07-13 15:56       ` Christoph Hellwig
2023-07-13 15:56       ` Christoph Hellwig
2023-07-14 11:50     ` [Cluster-devel] " Jan Stancek
2023-07-14 11:50       ` Jan Stancek
2023-07-14 11:50       ` Jan Stancek
2023-07-14 11:53       ` [Cluster-devel] " Cyril Hrubis
2023-07-14 11:53         ` Cyril Hrubis
2023-07-14 11:53         ` Cyril Hrubis
2023-07-13 15:12 ` [Cluster-devel] " Cyril Hrubis
2023-07-13 15:12   ` Cyril Hrubis
2023-07-13 15:12   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZLAZn_SBmoIFG5F5@yuki \
    --to=chrubis@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.