From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f194.google.com ([209.85.222.194]:40589 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728511AbeJHGhN (ORCPT ); Mon, 8 Oct 2018 02:37:13 -0400 Received: by mail-qk1-f194.google.com with SMTP id a13-v6so6446133qkc.7 for ; Sun, 07 Oct 2018 16:28:20 -0700 (PDT) From: Martin Brandenburg To: devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hubcap@omnibond.com Cc: Martin Brandenburg Subject: [PATCH 19/19] orangefs: do writepages_work if a single page must be written Date: Sun, 7 Oct 2018 23:27:36 +0000 Message-Id: <20181007232736.3780-20-martin@omnibond.com> In-Reply-To: <20181007232736.3780-1-martin@omnibond.com> References: <20181007232736.3780-1-martin@omnibond.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- 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