xfs
[Top] [All Lists]

[PATCH 2/6] xfs: ioends require logically contiguous file offsets

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/6] xfs: ioends require logically contiguous file offsets
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 7 Mar 2016 08:49:46 +1100
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1457300990-18300-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1457300990-18300-1-git-send-email-david@xxxxxxxxxxxxx>
From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>

We need to create a new ioend if the current writepage call isn't
logically contiguous with the range contained in the previous ioend.
Hopefully writepage gets called in order of increasing file offset.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
Signed-off-by: Dave Chinner <david@xxxxxxxxxxxxx>
---
 fs/xfs/xfs_aops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 7a467b3..75a39a8 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -526,7 +526,8 @@ xfs_add_to_ioend(
        struct list_head        *iolist)
 {
        if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type ||
-           bh->b_blocknr != wpc->last_block + 1) {
+           bh->b_blocknr != wpc->last_block + 1 ||
+           offset != wpc->ioend->io_offset + wpc->ioend->io_size) {
                struct xfs_ioend        *new;
 
                if (wpc->ioend)
-- 
2.7.0

<Prev in Thread] Current Thread [Next in Thread>