Re: [Cluster-devel] [GFS2][PATCH] - Allow journal recovery on read-only mount

2008-01-19 Thread Steven Whitehouse
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 [EMAIL PROTECTED]
 
   
 
 
 
 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;
  }
   
 
 



[Cluster-devel] [PATCH][GFS2] Lockup on error

2008-01-19 Thread Bob Peterson
Hi,

I spotted this bug while I was digging around.  Looks like it could cause
a lockup in some rare error condition.

Regards,

Bob Peterson
--
Signed-off-by: Bob Peterson [EMAIL PROTECTED] 
--
 fs/gfs2/inode.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index c84764a..728d316 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -860,7 +860,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct 
qstr *name,
 
error = alloc_required = gfs2_diradd_alloc_required(dip-i_inode, 
name);
if (alloc_required  0)
-   goto fail;
+   goto fail_quota_locks;
if (alloc_required) {
error = gfs2_quota_check(dip, dip-i_inode.i_uid, 
dip-i_inode.i_gid);
if (error)