summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2018-05-25 08:16:41 +0530
committerRaghavendra G <rgowdapp@redhat.com>2018-05-29 02:27:33 +0000
commitd44d531db1045df7b810567b2441e9f6bcc6a5dd (patch)
tree5596df91ee749978db16b1d15d26d002bf20ea19
parentc54702a34aa1feb86e2f5f2b1b238966a52ae37b (diff)
Revert "performance/write-behind: fix flush stuck by former failed writes"
This reverts commit 9340b3c7a6c8556d6f1d4046de0dbd1946a64963. operations/writes across different fds of the same file cannot be considered as independent. For eg., man 2 fsync states, <man 2 fsync> fsync() transfers ("flushes") all modified in-core data of (i.e., modified buffer cache pages for) the file referred to by the file descriptor fd to the disk device </man> This means fsync is an operation on file and fd is just a way to reach file. So, it has to sync writes done on other fds too. Patch 9340b3c7a6c, prevents this. The problem fixed by patch 9340b3c7a6c - a flush on an fd is hung on a failed write (held in cache for retrying) on a different fd - is solved in this patch by making sure __wb_request_waiting_on considers failed writes on any fd as dependent on flush/fsync on any fd (not just the fd on which writes happened) opened on the same file. This means failed writes on any fd are either synced or thrown away on witnessing flush/fsync on any fd of the same file. Change-Id: Iee748cebb6d2a5b32f9328aff2b5b7cbf6c52c05 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Updates: bz#1512691
-rw-r--r--xlators/performance/write-behind/src/write-behind.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index c80f0e7e271..20767955e4e 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -288,10 +288,6 @@ wb_requests_conflict (wb_request_t *lie, wb_request_t *req)
us in the todo list */
return _gf_false;
- /* requests from different fd do not conflict with each other. */
- if (req->fd && (req->fd != lie->fd))
- return _gf_false;
-
if (lie->ordering.append)
/* all modifications wait for the completion
of outstanding append */
@@ -744,9 +740,8 @@ __wb_request_waiting_on (wb_request_t *req)
wb_inode = req->wb_inode;
list_for_each_entry (trav, &wb_inode->todo, todo) {
- if ((trav->fd == req->fd)
- && ((trav->stub->fop == GF_FOP_FLUSH)
- || (trav->stub->fop == GF_FOP_FSYNC))
+ if (((trav->stub->fop == GF_FOP_FLUSH) || (trav->stub->fop
+ == GF_FOP_FSYNC))
&& (trav->gen >= req->gen))
return trav;
}