* [Cluster-devel] [GFS2 PATCH] GFS2: Fix direct IO write rounding error
[not found] <294948854.16958621.1453987470632.JavaMail.zimbra@redhat.com>
@ 2016-01-28 13:24 ` Bob Peterson
2016-01-28 13:29 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2016-01-28 13:24 UTC (permalink / raw)
To: cluster-devel.redhat.com
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>
---
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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [GFS2 PATCH] GFS2: Fix direct IO write rounding error
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
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2016-01-28 13:29 UTC (permalink / raw)
To: cluster-devel.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;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-28 13:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).