From patchwork Fri Feb 23 22:58:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 10239995 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 17A3460209 for ; Fri, 23 Feb 2018 22:58:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07A6929A63 for ; Fri, 23 Feb 2018 22:58:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE32E29A66; Fri, 23 Feb 2018 22:58:32 +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 66A5C29A63 for ; Fri, 23 Feb 2018 22:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157AbeBWW6b (ORCPT ); Fri, 23 Feb 2018 17:58:31 -0500 Received: from sandeen.net ([63.231.237.45]:44010 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbeBWW6b (ORCPT ); Fri, 23 Feb 2018 17:58:31 -0500 Received: from [10.0.0.4] (erlite [10.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id D0738116F0; Fri, 23 Feb 2018 16:57:39 -0600 (CST) Subject: Re: [PATCH] xfs/444: test log replay after XFS_IOC_SWAPEXT To: "Darrick J. Wong" Cc: fstests References: <9227d8db-faf6-5c19-239b-074c7f5cfc00@sandeen.net> <20180223215420.GE14582@magnolia> From: Eric Sandeen Message-ID: <4b4550ca-4c2a-2e5f-d49e-2b084d3c90f6@sandeen.net> Date: Fri, 23 Feb 2018 16:58:30 -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: <20180223215420.GE14582@magnolia> Content-Language: en-US Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2/23/18 3:54 PM, Darrick J. Wong wrote: > On Fri, Feb 23, 2018 at 12:33:41PM -0600, Eric Sandeen wrote: >> This is a mashup of xfs/042 and some of the log replay tests; >> it checks whether the log can be replayed if we crash immediately >> after an xfs_fsr / XFS_IOC_SWAPEXT. >> >> Hint: it can't. It fails because the temporary donor inode has >> been deleted and has invalid mode 0 when we try to replay its >> swapext operation. Kernel patches to fix it will follow soon. > > Hmm, does this filesystem have rmap enabled or not? Not when I tested it. I can try with it. > Different swapext strategy in play depending on the answer to that > question. Hm, ok. > Maybe I should wait for patches to show up. :P Something like this, with a better comment, and also skipping XFS_ILOG_[DA]OWNER on replay if mode == 0 to catch it on an upgrade if needed. --- To unsubscribe from this list: send the line "unsubscribe fstests" 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_inode_item.c b/fs/xfs/xfs_inode_item.c index 26f2413..72a0223 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -436,6 +436,12 @@ xfs_inode_item_format( ~(XFS_ILOG_ADATA | XFS_ILOG_ABROOT | XFS_ILOG_AEXT); } + /* If this inode has been deleted do not try to recover swapext */ + if (VFS_I(ip)->i_mode == 0) { + ilf->ilf_fields &= ~(XFS_ILOG_DOWNER | XFS_ILOG_AOWNER); + iip->ili_fields &= ~(XFS_ILOG_DOWNER | XFS_ILOG_AOWNER); + } + /* update the format with the exact fields we actually logged */ ilf->ilf_fields |= (iip->ili_fields & ~XFS_ILOG_TIMESTAMP); }