Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2245193pxx; Sat, 31 Oct 2020 13:09:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVa+SnGGCk5X3Iu/xU8p0WyOECj6wHwPeQy6kGoGobXwDi2Tq6QMJqI4Ull51J9tziAQlg X-Received: by 2002:aa7:d843:: with SMTP id f3mr9334437eds.354.1604174945961; Sat, 31 Oct 2020 13:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604174945; cv=none; d=google.com; s=arc-20160816; b=Pc9OkMLnXMpBal0wbdKFEamv9oJ2WaMFIAKMWlnvQbyD2+tSkn05pFZzZjTtb93qv/ q9+m1XdTgW766oKX4OVgAS4P2YY34bvnylsRbd5R4ecPUB6vY+EyEJErnkbhQYurrVzN Q89uVd2z+0snI+6f2LqgCRhx310qd2Iu32yV/wISA4ZSatUJWFc3si0jNKwF5s4VpYtd O9wdKnY3zPPzQI7Y3u7IadIk3NAdidjOahj7Z8mHj/CFpN5sZ1qqFU5zOFFQxMlXZkRA tlxK+iOI4DaTdefr89KOwv6aMKTPjuJkGmkjLm/J1nmuYxmxT1QzdepSH4UdTYrwmjCI gnsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2kN0bgsVSuQoMuR1Y4+Y61oz897QmYljIn8U6y9Kl2g=; b=KZajkHg/uLYZg/bUDJIVBMR33v2BykF6sVapbU4JD3+7fqAXXQIZVEybinlf4S+dOM uZqYbVdXdtjdfpgjnXwRL4uEtnATZE9t+9LZnQrnrC4Mz9rIg6oS3biC2r9KSpjOHdNv Hm5cugaBWZ9RZGMh2q9eBqDs1IhiE82IhPgWFifMRXKjk1hyWhiwj1gioPp18f3a5eW4 oQinhchZ8BJyNAk1E1ykn51EOR5BdESGVUNRWW/9xrLie0qzR1qBxzPkhRrMQs6l8kXf j3Gv3u5h8kFWHLxPhmngrCHWGqRyfHZWhaysyrY0Q6r9rcnpO/aObwHsoleIxypU1HLf NSlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="VyKbS/BW"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si7283045edt.426.2020.10.31.13.08.42; Sat, 31 Oct 2020 13:09:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="VyKbS/BW"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728561AbgJaUFz (ORCPT + 99 others); Sat, 31 Oct 2020 16:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728577AbgJaUFx (ORCPT ); Sat, 31 Oct 2020 16:05:53 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56A68C061A47 for ; Sat, 31 Oct 2020 13:05:53 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 133so7819356pfx.11 for ; Sat, 31 Oct 2020 13:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2kN0bgsVSuQoMuR1Y4+Y61oz897QmYljIn8U6y9Kl2g=; b=VyKbS/BWfH8XwIg08N7U4oyhZ19qEuLzjEHVNy+aqgbKUldwdeaTwEcJ1ivsY3M76c qed0OEECNh4WiOD01W38PRPuaMgsZfUEgjx02oFMw8HTkWGDtPeLl2jynIuUHHW71bU7 aG/MrcoX9EkE5t/q3y+qLhcnH3WFrmEKJRm0MSajp2990I8XrpqetpRbVfQZrBVamtYG 7llvPV+9/HJ47j44sCTn9yIIDvgWhZ6Y60/sAr5AmPfqS+uer/1Pbtj3zVV+Qfp36JvP 1OR0OgCJP8/oH3ac+3tqOVL2seN/X8VZaIQBJ4V0WRM6cYTrWVs6ty/zhBt50f1GYsyu UYgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2kN0bgsVSuQoMuR1Y4+Y61oz897QmYljIn8U6y9Kl2g=; b=MVVkg0hLU28HW2XJqdwuJd99fmsjwsQKyo+o0vfeVRCJr3esdhwtk1LyBo8xzfqL3R 6ic2fgY3Db1ZPYqijaTKFt51tLgltoT8jjlsxP3xue4MSd6CZuS4k91Ca/gGDZSn6Cme mIfGUxy9JTrTqHECl9uTqsweSppaW8JRnPLqXc7dD+HOiDRRzY5/qfKTpkKlmXzS042A 7whfmdzc2228ElrSu0XkuGKZgbYn2CMbXFxC91B8c9EfyshAWwGWUU5URrDyHYKJbbyL Wjch4Z8ggbwEu6B/YzWnu5cYUesvGWmuhRJePqO7TKuu89Z4esSQAU8eNLi56uFbvMg6 3hjw== X-Gm-Message-State: AOAM532wbOX02HDoKCAwgEczmYwLGzOO+Q3eZkbhvgmx9MnA48B+ANs2 xd11RQOisEJEsme40TQte3hNu912QDQ= X-Received: by 2002:a63:db53:: with SMTP id x19mr7282816pgi.39.1604174752502; Sat, 31 Oct 2020 13:05:52 -0700 (PDT) Received: from harshads-520.kir.corp.google.com ([2620:15c:17:10:a6ae:11ff:fe11:86a2]) by smtp.googlemail.com with ESMTPSA id t15sm17177102pjq.3.2020.10.31.13.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Oct 2020 13:05:51 -0700 (PDT) From: Harshad Shirwadkar To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, jack@suse.cz, Harshad Shirwadkar Subject: [PATCH 10/10] ext4: issue fsdev cache flush before starting fast commit Date: Sat, 31 Oct 2020 13:05:18 -0700 Message-Id: <20201031200518.4178786-11-harshadshirwadkar@gmail.com> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog In-Reply-To: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> References: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If the journal dev is different from fsdev, issue a cache flush before committing fast commit blocks to disk. Suggested-by: Jan Kara Signed-off-by: Harshad Shirwadkar --- fs/ext4/fast_commit.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c index 9ae8ba213961..facf2f59b895 100644 --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -996,6 +996,13 @@ static int ext4_fc_perform_commit(journal_t *journal) if (ret) return ret; + /* + * If file system device is different from journal device, issue a cache + * flush before we start writing fast commit blocks. + */ + if (journal->j_fs_dev != journal->j_dev) + blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS); + blk_start_plug(&plug); if (sbi->s_fc_bytes == 0) { /* -- 2.29.1.341.ge80a0c044ae-goog