From patchwork Thu Mar 9 20:24:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9614149 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 A531260417 for ; Thu, 9 Mar 2017 20:25:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 885E92866C for ; Thu, 9 Mar 2017 20:25:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 781742869D; Thu, 9 Mar 2017 20:25:15 +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 21C822866C for ; Thu, 9 Mar 2017 20:25:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751820AbdCIUZO (ORCPT ); Thu, 9 Mar 2017 15:25:14 -0500 Received: from sandeen.net ([63.231.237.45]:53032 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbdCIUZN (ORCPT ); Thu, 9 Mar 2017 15:25:13 -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 6ECE92B48; Thu, 9 Mar 2017 14:24:34 -0600 (CST) Subject: [PATCH 2/2] xfs: remove readonly checks from xfs_release & xfs_inactive To: Eric Sandeen , linux-xfs References: From: Eric Sandeen Message-ID: <36942625-073a-56ba-4d31-cd9511f3bfb8@sandeen.net> Date: Thu, 9 Mar 2017 14:24:38 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: 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 xfs_release & xfs_inactive both had early returns for readonly mounts. Ultimately, this means that when we do log recovery on a read-only mount, we do not process unlinked inodes, because of this misguided effort to not do /any/ IO, ever, on a readonly mount. IO at mount time is fine, and expected - after all we just got done doing log recovery! Even ro mounts, without the norecovery flag, can do enough IO to put the filesystem in a consistent state. We should not get here after mount is complete; at that point the vfs will not allow anything from userspace to make modifications which would get us here with any IO to do - we can't unlink files, or create blocks past eof, etc. So it's safe to just remove these checks. 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_inode.c b/fs/xfs/xfs_inode.c index edfa6a5..bf74165 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1658,10 +1658,6 @@ if (!S_ISREG(VFS_I(ip)->i_mode) || (VFS_I(ip)->i_mode == 0)) return 0; - /* If this is a read-only mount, don't do this (would generate I/O) */ - if (mp->m_flags & XFS_MOUNT_RDONLY) - return 0; - if (!XFS_FORCED_SHUTDOWN(mp)) { int truncated; @@ -1896,10 +1892,6 @@ mp = ip->i_mount; ASSERT(!xfs_iflags_test(ip, XFS_IRECOVERY)); - /* If this is a read-only mount, don't do this (would generate I/O) */ - if (mp->m_flags & XFS_MOUNT_RDONLY) - return; - if (VFS_I(ip)->i_nlink != 0) { /* * force is true because we are evicting an inode from the