[PATCH 19/19] orangefs: do writepages_work if a single page must be written

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Otherwise the next page can't possibly be an append and it'll
just sit there and write pages one by one until it flushes the
saved region at the very end.

Signed-off-by: Martin Brandenburg <martin@xxxxxxxxxxxx>
---
 fs/orangefs/inode.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index 20950f3f758a..cd1263c45bb2 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -307,6 +307,10 @@ static int orangefs_writepages_callback(struct page *page,
 	wr = (struct orangefs_write_request *)page_private(page);
 
 	if (wr->len != PAGE_SIZE) {
+		if (ow->npages) {
+			orangefs_writepages_work(ow, wbc);
+			ow->npages = 0;
+		}
 		ret = orangefs_writepage_locked(page, wbc);
 		mapping_set_error(page->mapping, ret);
 		unlock_page(page);
@@ -335,6 +339,10 @@ static int orangefs_writepages_callback(struct page *page,
 		}
 done:
 		if (ret == -1) {
+			if (ow->npages) {
+				orangefs_writepages_work(ow, wbc);
+				ow->npages = 0;
+			}
 			ret = orangefs_writepage_locked(page, wbc);
 			mapping_set_error(page->mapping, ret);
 			unlock_page(page);
-- 
2.19.0




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux