d1681e
From 3e7c6b338deb7a8b95b208b1aa087f97fb58549f Mon Sep 17 00:00:00 2001
d1681e
From: Raghavendra G <rgowdapp@redhat.com>
d1681e
Date: Fri, 25 May 2018 08:16:41 +0530
d1681e
Subject: [PATCH 287/305] Revert "performance/write-behind: fix flush stuck by
d1681e
 former failed writes"
d1681e
d1681e
This reverts commit 9340b3c7a6c8556d6f1d4046de0dbd1946a64963.
d1681e
d1681e
operations/writes across different fds of the same file cannot be
d1681e
considered as independent. For eg., man 2 fsync states,
d1681e
d1681e
<man 2 fsync>
d1681e
d1681e
fsync()  transfers  ("flushes")  all  modified  in-core  data of
d1681e
(i.e., modified buffer cache pages for) the file referred to by the
d1681e
file descriptor fd to the disk device
d1681e
d1681e
</man>
d1681e
d1681e
This means fsync is an operation on file and fd is just a way to reach
d1681e
file. So, it has to sync writes done on other fds too. Patch
d1681e
9340b3c7a6c, prevents this.
d1681e
d1681e
The problem fixed by patch 9340b3c7a6c - a flush on an fd is hung on a
d1681e
failed write (held in cache for retrying) on a different fd - is
d1681e
solved in this patch by making sure __wb_request_waiting_on considers
d1681e
failed writes on any fd as dependent on flush/fsync on any fd (not
d1681e
just the fd on which writes happened) opened on the same file. This
d1681e
means failed writes on any fd are either synced or thrown away on
d1681e
witnessing flush/fsync on any fd of the same file.
d1681e
d1681e
>Change-Id: Iee748cebb6d2a5b32f9328aff2b5b7cbf6c52c05
d1681e
>Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
d1681e
>Updates: bz#1512691
d1681e
d1681e
upstream patch: https://review.gluster.org/20082
d1681e
BUG: 1518710
d1681e
Change-Id: Ie9df1cb2fcd698db3d186485fd61ea6dc1c1fcb7
d1681e
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/140063
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
Reviewed-by: Csaba Henk <chenk@redhat.com>
d1681e
Tested-by: Csaba Henk <chenk@redhat.com>
d1681e
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
d1681e
---
d1681e
 xlators/performance/write-behind/src/write-behind.c | 9 ++-------
d1681e
 1 file changed, 2 insertions(+), 7 deletions(-)
d1681e
d1681e
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
d1681e
index 7104eb9..ca1cb63 100644
d1681e
--- a/xlators/performance/write-behind/src/write-behind.c
d1681e
+++ b/xlators/performance/write-behind/src/write-behind.c
d1681e
@@ -287,10 +287,6 @@ wb_requests_conflict (wb_request_t *lie, wb_request_t *req)
d1681e
 		   us in the todo list */
d1681e
 		return _gf_false;
d1681e
 
d1681e
-        /* requests from different fd do not conflict with each other. */
d1681e
-        if (req->fd && (req->fd != lie->fd))
d1681e
-                return _gf_false;
d1681e
-
d1681e
 	if (lie->ordering.append)
d1681e
 		/* all modifications wait for the completion
d1681e
 		   of outstanding append */
d1681e
@@ -743,9 +739,8 @@ __wb_request_waiting_on (wb_request_t *req)
d1681e
         wb_inode = req->wb_inode;
d1681e
 
d1681e
         list_for_each_entry (trav, &wb_inode->todo, todo) {
d1681e
-                if ((trav->fd == req->fd)
d1681e
-                    && ((trav->stub->fop == GF_FOP_FLUSH)
d1681e
-                        || (trav->stub->fop == GF_FOP_FSYNC))
d1681e
+                if (((trav->stub->fop == GF_FOP_FLUSH) || (trav->stub->fop
d1681e
+                                                           == GF_FOP_FSYNC))
d1681e
                     && (trav->gen >= req->gen))
d1681e
                         return trav;
d1681e
         }
d1681e
-- 
d1681e
1.8.3.1
d1681e