cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2][PATCH] - Allow journal recovery on read-only mount
@ 2008-01-18 20:06 Abhijith Das
  2008-01-18 20:35 ` Abhijith Das
  2008-01-21  9:14 ` [Cluster-devel] " Steven Whitehouse
  0 siblings, 2 replies; 4+ messages in thread
From: Abhijith Das @ 2008-01-18 20:06 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This patch allows gfs2 to perform journal recovery even if it is mounted
read-only. Strictly speaking, a read-only mount should not be writing to
the filesystem, but we do this only to perform journal recovery. A
read-only mount will fail if we don't recover the dirty journal. Also,
when gfs2 is used as a root filesystem, it will be mounted read-only
before being mounted read-write during the boot sequence. A failed
read-only mount will panic the machine during bootup.

Signed-off-by: Abhijith Das <adas@redhat.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: journal-recovery-on-RO-mount.patch
Type: text/x-patch
Size: 889 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20080118/87848243/attachment.bin>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] [GFS2][PATCH] - Allow journal recovery on read-only mount
  2008-01-18 20:06 [Cluster-devel] [GFS2][PATCH] - Allow journal recovery on read-only mount Abhijith Das
@ 2008-01-18 20:35 ` Abhijith Das
  2008-01-19 17:50   ` Steven Whitehouse
  2008-01-21  9:14 ` [Cluster-devel] " Steven Whitehouse
  1 sibling, 1 reply; 4+ messages in thread
From: Abhijith Das @ 2008-01-18 20:35 UTC (permalink / raw)
  To: cluster-devel.redhat.com

I'm NACKing this on Dave's suggestion that we restrict this behavior to
standalone gfs2 filesystems (lock_nolock). I'm working on a patch for
that and will post it soon.

--Abhi

Abhijith Das wrote:

>This patch allows gfs2 to perform journal recovery even if it is mounted
>read-only. Strictly speaking, a read-only mount should not be writing to
>the filesystem, but we do this only to perform journal recovery. A
>read-only mount will fail if we don't recover the dirty journal. Also,
>when gfs2 is used as a root filesystem, it will be mounted read-only
>before being mounted read-write during the boot sequence. A failed
>read-only mount will panic the machine during bootup.
>
>Signed-off-by: Abhijith Das <adas@redhat.com>
>
>  
>
>------------------------------------------------------------------------
>
>diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
>index 27c994f..b249e29 100644
>--- a/fs/gfs2/recovery.c
>+++ b/fs/gfs2/recovery.c
>@@ -504,13 +504,21 @@ int gfs2_recover_journal(struct gfs2_jde
> 			if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags))
> 				ro = 1;
> 		} else {
>-			if (sdp->sd_vfs->s_flags & MS_RDONLY)
>-				ro = 1;
>+			if (sdp->sd_vfs->s_flags & MS_RDONLY) {
>+				/* check if device itself is read-only */
>+				ro = bdev_read_only(sdp->sd_vfs->s_bdev);
>+				if (!ro) {
>+					fs_info(sdp, "recovery required on "
>+						"read-only filesystem.\n");
>+					fs_info(sdp, "write access will be "
>+						"enabled during recovery.\n");
>+				}
>+			}
> 		}
> 
> 		if (ro) {
>-			fs_warn(sdp, "jid=%u: Can't replay: read-only FS\n",
>-				jd->jd_jid);
>+			fs_warn(sdp, "jid=%u: Can't replay: read-only block "
>+				"device\n", jd->jd_jid);
> 			error = -EROFS;
> 			goto fail_gunlock_tr;
> 		}
>  
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] [GFS2][PATCH] - Allow journal recovery on read-only mount
  2008-01-18 20:35 ` Abhijith Das
@ 2008-01-19 17:50   ` Steven Whitehouse
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Whitehouse @ 2008-01-19 17:50 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On Fri, 2008-01-18 at 14:35 -0600, Abhijith Das wrote:
> I'm NACKing this on Dave's suggestion that we restrict this behavior to
> standalone gfs2 filesystems (lock_nolock). I'm working on a patch for
> that and will post it soon.
> 
> --Abhi
> 
Why? I don't see the need for such a restriction. The original patch
looks ok to me,

Steve.

> Abhijith Das wrote:
> 
> >This patch allows gfs2 to perform journal recovery even if it is mounted
> >read-only. Strictly speaking, a read-only mount should not be writing to
> >the filesystem, but we do this only to perform journal recovery. A
> >read-only mount will fail if we don't recover the dirty journal. Also,
> >when gfs2 is used as a root filesystem, it will be mounted read-only
> >before being mounted read-write during the boot sequence. A failed
> >read-only mount will panic the machine during bootup.
> >
> >Signed-off-by: Abhijith Das <adas@redhat.com>
> >
> >  
> >
> >------------------------------------------------------------------------
> >
> >diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
> >index 27c994f..b249e29 100644
> >--- a/fs/gfs2/recovery.c
> >+++ b/fs/gfs2/recovery.c
> >@@ -504,13 +504,21 @@ int gfs2_recover_journal(struct gfs2_jde
> > 			if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags))
> > 				ro = 1;
> > 		} else {
> >-			if (sdp->sd_vfs->s_flags & MS_RDONLY)
> >-				ro = 1;
> >+			if (sdp->sd_vfs->s_flags & MS_RDONLY) {
> >+				/* check if device itself is read-only */
> >+				ro = bdev_read_only(sdp->sd_vfs->s_bdev);
> >+				if (!ro) {
> >+					fs_info(sdp, "recovery required on "
> >+						"read-only filesystem.\n");
> >+					fs_info(sdp, "write access will be "
> >+						"enabled during recovery.\n");
> >+				}
> >+			}
> > 		}
> > 
> > 		if (ro) {
> >-			fs_warn(sdp, "jid=%u: Can't replay: read-only FS\n",
> >-				jd->jd_jid);
> >+			fs_warn(sdp, "jid=%u: Can't replay: read-only block "
> >+				"device\n", jd->jd_jid);
> > 			error = -EROFS;
> > 			goto fail_gunlock_tr;
> > 		}
> >  
> >
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] Re: [GFS2][PATCH] - Allow journal recovery on read-only mount
  2008-01-18 20:06 [Cluster-devel] [GFS2][PATCH] - Allow journal recovery on read-only mount Abhijith Das
  2008-01-18 20:35 ` Abhijith Das
@ 2008-01-21  9:14 ` Steven Whitehouse
  1 sibling, 0 replies; 4+ messages in thread
From: Steven Whitehouse @ 2008-01-21  9:14 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On Fri, 2008-01-18 at 14:06 -0600, Abhijith Das wrote:
> This patch allows gfs2 to perform journal recovery even if it is mounted
> read-only. Strictly speaking, a read-only mount should not be writing to
> the filesystem, but we do this only to perform journal recovery. A
> read-only mount will fail if we don't recover the dirty journal. Also,
> when gfs2 is used as a root filesystem, it will be mounted read-only
> before being mounted read-write during the boot sequence. A failed
> read-only mount will panic the machine during bootup.
> 
> Signed-off-by: Abhijith Das <adas@redhat.com>
> 

I've applied this one since I want to get all the patches ready for
posting prior to the forthcoming merge window. If we need to alter it,
then we can do that later,

Steve.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-21  9:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-18 20:06 [Cluster-devel] [GFS2][PATCH] - Allow journal recovery on read-only mount Abhijith Das
2008-01-18 20:35 ` Abhijith Das
2008-01-19 17:50   ` Steven Whitehouse
2008-01-21  9:14 ` [Cluster-devel] " Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).