From patchwork Thu Sep 23 13:08:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 12512931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16C10C4321E for ; Thu, 23 Sep 2021 13:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 027526115A for ; Thu, 23 Sep 2021 13:24:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241394AbhIWNZv (ORCPT ); Thu, 23 Sep 2021 09:25:51 -0400 Received: from sender2-op-o12.zoho.com.cn ([163.53.93.243]:17272 "EHLO sender2-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241357AbhIWNZo (ORCPT ); Thu, 23 Sep 2021 09:25:44 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1632402523; cv=none; d=zoho.com.cn; s=zohoarc; b=qH3ngKsxfDBir5NbpElwAqfEGQ6iHB041TE9vOS2w3gnqi1XONO2MMlLMRdbKRgbRfWsfFNtxgxtGDqp1YrzCkkx/VWeEV07mKNhKk70pFWgq+2gXh/Lrzkm5sshuksLpUeEDxuZGJMk6BcTA8DMN6od7bPBmOKnq2+6KZXIhxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1632402523; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=SJerK8hn3kKJX7a0C29xFImquFtm+fSY+XjyQ7ULrjs=; b=VcF6xUTRV2Z0fmfyEphbwYgIYz52AXlEBzlBP2RZnHlA80o+1qaQGwFnBRFfhzhWhNTJlgqzFxmyxOQdzghh2n6q/r4ey5kfzb5ojsuCQcY1DOi7klQrQ9RS5ythmJOSV0FoyZ0T7A4hgRzWHsbOSDUwFXFZtlaXyzkv1gaVwjs= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1632402523; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=SJerK8hn3kKJX7a0C29xFImquFtm+fSY+XjyQ7ULrjs=; b=MwQ5U9dtYqlgPS1baurzUMI0iLzWurkQBJwILxnogau7MtDCArgzgsLxI7yYtGZ8 +3z1v/Hgd3Y/Amfd7+2O70S07JhSlnNvafHGF8sIx1+5XCE+x51+1xPs0BhDPhCxFyL v3FFzjVsYlDCHSXvNKqKc6uElBrpB8MG+PVj29QU= Received: from localhost.localdomain (81.71.33.115 [81.71.33.115]) by mx.zoho.com.cn with SMTPS id 1632402521611230.03974667116563; Thu, 23 Sep 2021 21:08:41 +0800 (CST) From: Chengguang Xu To: miklos@szeredi.hu, jack@suse.cz, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org, Chengguang Xu Message-ID: <20210923130814.140814-9-cgxu519@mykernel.net> Subject: [RFC PATCH v5 08/10] fs: export wait_sb_inodes() Date: Thu, 23 Sep 2021 21:08:12 +0800 X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210923130814.140814-1-cgxu519@mykernel.net> References: <20210923130814.140814-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org In order to wait syncing upper inodes we need to call wait_sb_inodes() in overlayfs' ->sync_fs. Signed-off-by: Chengguang Xu --- fs/fs-writeback.c | 3 ++- include/linux/writeback.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 81ec192ce067..0438c911241e 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2505,7 +2505,7 @@ EXPORT_SYMBOL(__mark_inode_dirty); * completed by the time we have gained the lock and waited for all IO that is * in progress regardless of the order callers are granted the lock. */ -static void wait_sb_inodes(struct super_block *sb) +void wait_sb_inodes(struct super_block *sb) { LIST_HEAD(sync_list); @@ -2589,6 +2589,7 @@ static void wait_sb_inodes(struct super_block *sb) rcu_read_unlock(); mutex_unlock(&sb->s_sync_lock); } +EXPORT_SYMBOL(wait_sb_inodes); static void __writeback_inodes_sb_nr(struct super_block *sb, unsigned long nr, enum wb_reason reason, bool skip_if_busy) diff --git a/include/linux/writeback.h b/include/linux/writeback.h index d1f65adf6a26..d7aacd0434cf 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -198,6 +198,7 @@ void wakeup_flusher_threads_bdi(struct backing_dev_info *bdi, enum wb_reason reason); void inode_wait_for_writeback(struct inode *inode); void inode_io_list_del(struct inode *inode); +void wait_sb_inodes(struct super_block *sb); /* writeback.h requires fs.h; it, too, is not included from here. */ static inline void wait_on_inode(struct inode *inode)