From patchwork Tue Jan 30 02:02:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10191271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6C76F6056E for ; Tue, 30 Jan 2018 02:03:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51A9B28918 for ; Tue, 30 Jan 2018 02:03:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 466AD2891A; Tue, 30 Jan 2018 02:03:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A850028918 for ; Tue, 30 Jan 2018 02:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752189AbeA3CDN (ORCPT ); Mon, 29 Jan 2018 21:03:13 -0500 Received: from mr11p00im-asmtp004.me.com ([17.110.69.135]:19171 "EHLO mr11p00im-asmtp004.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752035AbeA3CDN (ORCPT ); Mon, 29 Jan 2018 21:03:13 -0500 Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P3C00A00IY8UH00@mr11p00im-asmtp004.me.com> for ceph-devel@vger.kernel.org; Tue, 30 Jan 2018 02:02:43 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1517277763; bh=oR3sAz3zbwX/UYodMGGxfumxBUUw0OB3SFTo4gxCGaM=; h=From:To:Subject:Date:Message-id; b=WrbC8hRXHtPdMJxWuYaRUSzWydKN8lLnNVkWeqq8Z7LhqUulW2LS8/ARaEGdHRBXq qG4GRZebnoYic9QRUCWXMPtBGokzndFdp3cPEAFysYMw1+E0yDkVhhyI5lMB9X4rZl 0gT5BbqLaSI5wYyV+emvT0lbsWvgczoi+G5D/40MP6v9LDWf728VR+RwydRwQgvxUD 71fwUJLfFAXO/26YvCbEbBR6nSSrguw31q2WDr4e9dh0i22szfjl3sZBp6bU83jPO7 LJUnbmz16YtDi5iqpcTYTvcYgnlMQ//0RtjXZPZeR+VVu1bce+VrUzT8+Lvin0qcp+ op0V3sJ0ldQrw== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P3C00BT7J0BDD30@mr11p00im-asmtp004.me.com>; Tue, 30 Jan 2018 02:02:41 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-30_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1801300025 From: Chengguang Xu To: zyan@redhat.com, idryomov@gmail.com Cc: sage@redhat.com, ceph-devel@vger.kernel.org, Chengguang Xu Subject: [PATCH] ceph: improving efficiency of syncfs Date: Tue, 30 Jan 2018 10:02:30 +0800 Message-id: <1517277750-144449-1-git-send-email-cgxu519@icloud.com> X-Mailer: git-send-email 1.8.3.1 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP write_inode() could be called variety of reasons, in the case of syncfs(2) there is no need to wait for flush getting completed in write_inode(), ->sync_fs is for guaranteeing flush completion for all inodes at that point. Signed-off-by: Chengguang Xu --- fs/ceph/caps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index a14b2c9..fd6ce29 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -2160,7 +2160,7 @@ int ceph_write_inode(struct inode *inode, struct writeback_control *wbc) u64 flush_tid; int err = 0; int dirty; - int wait = wbc->sync_mode == WB_SYNC_ALL; + int wait = (wbc->sync_mode == WB_SYNC_ALL && !wbc->for_sync); dout("write_inode %p wait=%d\n", inode, wait); if (wait) {