From patchwork Wed Mar 7 23:33:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 10265633 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 683BD602C8 for ; Wed, 7 Mar 2018 23:33:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AA2429196 for ; Wed, 7 Mar 2018 23:33:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F39F29198; Wed, 7 Mar 2018 23:33:51 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 E46CF29196 for ; Wed, 7 Mar 2018 23:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754981AbeCGXdu (ORCPT ); Wed, 7 Mar 2018 18:33:50 -0500 Received: from sandeen.net ([63.231.237.45]:48290 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754834AbeCGXdu (ORCPT ); Wed, 7 Mar 2018 18:33:50 -0500 Received: from [10.0.0.4] (liberator [10.0.0.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 830B6452064; Wed, 7 Mar 2018 17:32:42 -0600 (CST) Subject: [PATCH 2/2] xfs: don't dirty snapshot logs for unlinked inode recovery To: Eric Sandeen , linux-xfs References: <83696ce6-4054-0e77-b4b8-e82a1a9fbbc3@redhat.com> From: Eric Sandeen Message-ID: <896a0202-aac8-e43f-7ea6-3718591e32aa@sandeen.net> Date: Wed, 7 Mar 2018 17:33:48 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <83696ce6-4054-0e77-b4b8-e82a1a9fbbc3@redhat.com> Content-Language: en-US Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that unlinked inode recovery is done outside of log recovery, there is no need to dirty the log on snapshots just to handle unlinked inodes. This means that readonly snapshots can be mounted without requiring -o ro,norecovery to avoid the log replay that can't happen on a readonly block device. (unlinked inodes will just hang out in the agi buckets until the next writable mount) Signed-off-by: Eric Sandeen --- -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 93588ea..5669525 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1419,9 +1419,10 @@ struct proc_xfs_info { /* * Second stage of a freeze. The data is already frozen so we only - * need to take care of the metadata. Once that's done sync the superblock - * to the log to dirty it in case of a crash while frozen. This ensures that we - * will recover the unlinked inode lists on the next mount. + * need to take care of the metadata. + * Any unlinked inode lists will remain at this point, and be recovered + * on the next writable mount if we crash while frozen, or create + * a snapshot from the frozen filesystem. */ STATIC int xfs_fs_freeze( @@ -1431,7 +1432,7 @@ struct proc_xfs_info { xfs_save_resvblks(mp); xfs_quiesce_attr(mp); - return xfs_sync_sb(mp, true); + return 0; } STATIC int