From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp1040.oracle.com ([141.146.126.69]:20555 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753325AbdHKTrT (ORCPT ); Fri, 11 Aug 2017 15:47:19 -0400 Date: Fri, 11 Aug 2017 12:47:10 -0700 From: "Darrick J. Wong" Subject: Re: [PATCH 2/2 V2] xfs: toggle readonly state around xfs_log_mount_finish Message-ID: <20170811194710.GF24087@magnolia> References: <6c81fb42-4601-dc0f-6ebb-a73c7c40aaa4@sandeen.net> <537e1ca3-60be-8182-7130-dff3a1059078@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <537e1ca3-60be-8182-7130-dff3a1059078@sandeen.net> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Eric Sandeen Cc: Eric Sandeen , linux-xfs On Fri, Aug 11, 2017 at 12:45:05PM -0700, Eric Sandeen wrote: > When we do log recovery on a readonly mount, unlinked inode > processing does not happen due to the readonly checks in > xfs_inactive(), which are trying to prevent any I/O on a > readonly mount. > > This is misguided - we do I/O on readonly mounts all the time, > for consistency; for example, log recovery. So do the same > RDONLY flag twiddling around xfs_log_mount_finish() as we > do around xfs_log_mount(), for the same reason. > > This all cries out for a big rework but for now this is a > simple fix to an obvious problem. > > Signed-off-by: Eric Sandeen > Reviewed-by: Brian Foster > Reviewed-by: Darrick J. Wong > --- > > V2: bool "readonly" per Christoph's request > Looks good, will test... Reviewed-by: Darrick J. Wong > diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c > index 0bd1341..ca56d85 100644 > --- a/fs/xfs/xfs_log.c > +++ b/fs/xfs/xfs_log.c > @@ -743,16 +743,23 @@ > struct xfs_mount *mp) > { > int error = 0; > + bool readonly = (mp->m_flags & XFS_MOUNT_RDONLY); > > if (mp->m_flags & XFS_MOUNT_NORECOVERY) { > ASSERT(mp->m_flags & XFS_MOUNT_RDONLY); > return 0; > + } else if (readonly) { > + /* Allow unlinked processing to proceed */ > + mp->m_flags &= ~XFS_MOUNT_RDONLY; > } > > error = xlog_recover_finish(mp->m_log); > if (!error) > xfs_log_work_queue(mp); > > + if (readonly) > + mp->m_flags |= XFS_MOUNT_RDONLY; > + > return error; > } > > > > -- > 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