Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   GFS2: Read in rindex if necessary during unlink (http://www.linux-archive.org/cluster-development/633950-gfs2-read-rindex-if-necessary-during-unlink.html)

Bob Peterson 02-16-2012 03:31 PM

GFS2: Read in rindex if necessary during unlink
 
Hi,

This patch fixes a problem whereby you were unable to delete
files until other file system operations were done (such as
statfs, touch, writes, etc.) that caused the rindex to be
read in.

Regards,

Bob Peterson
Red Hat File Systems

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
--
GFS2: Read in rindex if necessary during unlink

GFS2 was unable to delete files until the rindex file was read
in by another operation, such as statfs or a file write.
This patch adds a call to gfs2_rindex_update to gfs2_unlink.
The problem was introduced in patch 8339ee5.

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 1a84ad9..cee74c8 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1035,14 +1035,19 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
struct buffer_head *bh;
struct gfs2_holder ghs[3];
struct gfs2_rgrpd *rgd;
- int error = -EROFS;
+ int error;

+ error = gfs2_rindex_update(sdp);
+ if (error)
+ return error;
gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs);
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1);

rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr, 1);
- if (!rgd)
+ if (!rgd) {
+ error = -EROFS;
goto out_inodes;
+ }
gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2);

Steven Whitehouse 02-28-2012 10:11 AM

GFS2: Read in rindex if necessary during unlink
 
From: Bob Peterson <rpeterso@redhat.com>

This patch fixes a problem whereby you were unable to delete
files until other file system operations were done (such as
statfs, touch, writes, etc.) that caused the rindex to be
read in.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index a7d611b..c87faf4 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1035,14 +1035,19 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
struct buffer_head *bh;
struct gfs2_holder ghs[3];
struct gfs2_rgrpd *rgd;
- int error = -EROFS;
+ int error;

+ error = gfs2_rindex_update(sdp);
+ if (error)
+ return error;
gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs);
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1);

rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr);
- if (!rgd)
+ if (!rgd) {
+ error = -EROFS;
goto out_inodes;
+ }
gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2);


--
1.7.4


All times are GMT. The time now is 08:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.