All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH 2/2] xfs: remove readonly checks from xfs_release & xfs_inactive
Date: Thu, 9 Mar 2017 14:24:38 -0600	[thread overview]
Message-ID: <36942625-073a-56ba-4d31-cd9511f3bfb8@sandeen.net> (raw)
In-Reply-To: <bbb0243d-e491-02e0-1802-e95cba4e8486@redhat.com>

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 <sandeen@redhat.com>
---

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

  parent reply	other threads:[~2017-03-09 20:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 19:40 [PATCH 0/2] xfs: readonly handling changes Eric Sandeen
2017-03-09 20:15 ` [PATCH 1/2] xfs: write unmount record for ro mounts Eric Sandeen
2017-03-15 15:18   ` Brian Foster
2017-03-09 20:24 ` Eric Sandeen [this message]
2017-03-09 20:39   ` [PATCH 2/2] xfs: remove readonly checks from xfs_release & xfs_inactive Eric Sandeen
2017-03-13 13:23     ` Brian Foster
2017-03-13 22:16       ` Eric Sandeen
2017-03-14 11:35         ` Brian Foster
2017-03-14 23:23   ` [PATCH 2/2 V2] xfs: toggle readonly state around xfs_log_mount_finish Eric Sandeen
2017-03-15 11:36     ` Brian Foster
2017-03-16 19:15       ` Darrick J. Wong
2017-03-16 23:42         ` Dave Chinner
2017-03-16 23:52           ` Eric Sandeen
2017-03-18  7:38             ` Dave Chinner
2017-03-27 17:16               ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36942625-073a-56ba-4d31-cd9511f3bfb8@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.