From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Fix direct IO write rounding error
Date: Thu, 28 Jan 2016 13:29:18 +0000 [thread overview]
Message-ID: <56AA17AE.9050709@redhat.com> (raw)
In-Reply-To: <1461737039.16958702.1453987493013.JavaMail.zimbra@redhat.com>
Hi,
On 28/01/16 13:24, Bob Peterson wrote:
> Hi,
>
> The fsx test in xfstests was failing because it was using direct IO
> writes which were using a bad calculation. It was using
> loff_t lstart = offset & (PAGE_CACHE_SIZE - 1); when it should be
> loff_t lstart = offset & ~(PAGE_CACHE_SIZE - 1);
> Thus, the write at offset 0x67e00 was calculating lstart to be
> 0xe00, the address of our corruption. Instead, it should have been
> 0x67000. This patch fixes the calculation.
>
> Regards,
>
> Bob Peterson
> Red Hat File Systems
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Steve.
> ---
> diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
> index 93f0746..aa016e4 100644
> --- a/fs/gfs2/aops.c
> +++ b/fs/gfs2/aops.c
> @@ -1082,7 +1082,7 @@ static ssize_t gfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
> * the first place, mapping->nr_pages will always be zero.
> */
> if (mapping->nrpages) {
> - loff_t lstart = offset & (PAGE_CACHE_SIZE - 1);
> + loff_t lstart = offset & ~(PAGE_CACHE_SIZE - 1);
> loff_t len = iov_iter_count(iter);
> loff_t end = PAGE_ALIGN(offset + len) - 1;
>
>
prev parent reply other threads:[~2016-01-28 13:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <294948854.16958621.1453987470632.JavaMail.zimbra@redhat.com>
2016-01-28 13:24 ` [Cluster-devel] [GFS2 PATCH] GFS2: Fix direct IO write rounding error Bob Peterson
2016-01-28 13:29 ` Steven Whitehouse [this message]
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=56AA17AE.9050709@redhat.com \
--to=swhiteho@redhat.com \
/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.