From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sandeen.net ([63.231.237.45]:59776 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751632AbeCXANo (ORCPT ); Fri, 23 Mar 2018 20:13:44 -0400 Subject: [PATCH V2] xfs: do not log swapext extent owner changes for deleted inodes References: From: Eric Sandeen Message-ID: Date: Fri, 23 Mar 2018 19:13:43 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Eric Sandeen , linux-xfs , Brian Foster Today if we run fsr and crash, log replay can fail because the recovery code tries to instantiate the donor inode from disk to replay the swapext, but it's been deleted and we get verifier failures when we try to read it off disk with i_mode == 0. Strip the extent owner changes out of the logged fields when we're freeing the inode to avoid this. Signed-off-by: Eric Sandeen --- V2: Move the fix to xfs_ifree per bfoster's suggestion diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 604ee38..d17e2d5 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -2470,6 +2470,10 @@ ip->i_d.di_forkoff = 0; /* mark the attr fork not in use */ ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS; ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; + + /* Don't attempt to replay owner changes for a deleted inode */ + ip->i_itemp->ili_fields &= !(XFS_ILOG_AOWNER|XFS_ILOG_DOWNER); + /* * Bump the generation count so no one will be confused * by reincarnations of this inode.