From patchwork Tue Mar 22 17:55:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 8644441 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1C84CC0554 for ; Tue, 22 Mar 2016 17:57:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 422BE20115 for ; Tue, 22 Mar 2016 17:57:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6157220131 for ; Tue, 22 Mar 2016 17:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757195AbcCVRze (ORCPT ); Tue, 22 Mar 2016 13:55:34 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:17943 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750721AbcCVRzc (ORCPT ); Tue, 22 Mar 2016 13:55:32 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u2MHppWn010858; Tue, 22 Mar 2016 10:55:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=DHcwd83wt9yamQI1zH6CT7qtpJqte2ZhDMTh515tMK4=; b=pRiAmPT9RDailNkFFxtVh8cd4cEvtH7EFhB8HbnOA7Eimc0XRyGTcBPzmInbeMTFCyr2 ce+svxvzo3JkspB9tJsuHGv4ijZDHWB07Lqe6HydN5dFY0erbNBRYf0tKoqZtJB9MuRN bwgqBynXIZ3vVfA7I2eMHW+yQCTDcX7Z6ew= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 21u8u88qfr-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT); Tue, 22 Mar 2016 10:55:32 -0700 Received: from localhost.localdomain (192.168.54.13) by mail.thefacebook.com (192.168.16.21) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 10:55:30 -0700 From: Jens Axboe To: , , CC: Jens Axboe Subject: [PATCH 2/6] writeback: wb_start_writeback() should use WB_SYNC_ALL for WB_REASON_SYNC Date: Tue, 22 Mar 2016 11:55:16 -0600 Message-ID: <1458669320-6819-3-git-send-email-axboe@fb.com> X-Mailer: git-send-email 2.4.1.168.g1ea28e1 In-Reply-To: <1458669320-6819-1-git-send-email-axboe@fb.com> References: <1458669320-6819-1-git-send-email-axboe@fb.com> MIME-Version: 1.0 X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-03-22_09:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If you call sync, the initial call to wakeup_flusher_threads() ends up calling wb_start_writeback() with reason=WB_REASON_SYNC, but wb_start_writeback() always uses WB_SYNC_NONE as the writeback mode. Ensure that we use WB_SYNC_ALL for a sync operation. Signed-off-by: Jens Axboe --- fs/fs-writeback.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 5c46ed9f3e14..97a9e9987134 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -936,7 +936,10 @@ void wb_start_writeback(struct bdi_writeback *wb, long nr_pages, return; } - work->sync_mode = WB_SYNC_NONE; + if (reason == WB_REASON_SYNC) + work->sync_mode = WB_SYNC_ALL; + else + work->sync_mode = WB_SYNC_NONE; work->nr_pages = nr_pages; work->range_cyclic = range_cyclic; work->reason = reason;