GFS2: Pre-pull patch posting (fixes)
Hi,
Here are four fixes for issues that have come up since the last merge window,
Steve.
PATCH 1/4 GFS2: put glock reference in error patch of read_rindex_entry
From: Bob Peterson <[email protected]>
This patch fixes the error path of function read_rindex_entry so that it correctly gives up its glock reference in cases where there is a race to re-read the rindex after gfs2_grow.
fs/gfs2/rgrp.c +1 -0
@@ -640,6 +640,7 @@ static int read_rindex_entry(struct gfs2_inode *ip,return 0 ; error =0 ;/* someone else read in the rgrp; free it and ignore it */ +gfs2_glock_put (rgd->rd_gl); fail:kfree (rgd->rd_bits);
Signature · 1 line
1.7.4
PATCH 2/4 GFS2: use depends instead of select in kconfig
In reply to Steven WhitehouseFrom: Benjamin Poirier <[email protected]>
Avoids having to duplicate the dependencies of what is 'select'ed (and on down...)
Those dependencies are currently incomplete, leading to broken builds with GFS2_FS_LOCKING_DLM=y and IP_SCTP=n.
fs/gfs2/Kconfig +2 -5
@@ -1,10 +1,6 @@ config GFS2_FS tristate "GFS2 file system support" depends on (64BIT || LBDAF) - select DLM if GFS2_FS_LOCKING_DLM - select CONFIGFS_FS if GFS2_FS_LOCKING_DLM - select SYSFS if GFS2_FS_LOCKING_DLM - select IP_SCTP if DLM_SCTP select FS_POSIX_ACL select CRC32 select QUOTACTL
@@ -29,7 +25,8 @@ config GFS2_FS config GFS2_FS_LOCKING_DLM bool "GFS2 DLM locking" - depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && HOTPLUG + depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && \ + HOTPLUG && DLM && CONFIGFS_FS && SYSFS help Multiple node locking module for GFS2
Signature · 1 line
1.7.4
PATCH 3/4 GFS2: Make sure rindex is uptodate before starting transactions
In reply to Steven WhitehouseFrom: Bob Peterson <[email protected]>
This patch removes the call from gfs2_blk2rgrd to function gfs2_rindex_update and replaces it with individual calls. The former way turned out to be too problematic.
fs/gfs2/bmap.c +5 -1
@@ -724,7 +724,11 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,int metadata;unsigned int revokes =0 ;int x; -int error =0 ; +int error; + + error =gfs2_rindex_update (sdp); +if (error) +return error;if (!*top) sm->sm_first =0 ;
fs/gfs2/dir.c +4 -0
@@ -1844,6 +1844,10 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,unsigned int x, size = len *sizeof (u64);int error; + error =gfs2_rindex_update (sdp); +if (error) +return error; +memset (&rlist,0 ,sizeof (struct gfs2_rgrp_list )); ht =kzalloc (size,GFP_NOFS );
fs/gfs2/inode.c +11 -2
@@ -1031,7 +1031,13 @@ 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; + + error = -EROFS ;gfs2_holder_init (dip->i_gl,LM_ST_EXCLUSIVE ,0 , ghs);gfs2_holder_init (ip->i_gl,LM_ST_EXCLUSIVE ,0 , ghs +1 );
@@ -1224,6 +1230,10 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,return 0 ; } + error =gfs2_rindex_update (sdp); +if (error) +return error; +if (odip != ndip) { error =gfs2_glock_nq_init (sdp->sd_rename_gl,LM_ST_EXCLUSIVE ,0 , &r_gh);
@@ -1345,7 +1355,6 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, error = alloc_required;if (error <0 ) goto out_gunlock; - error =0 ;if (alloc_required) {struct gfs2_qadata *qa =gfs2_qadata_get (ndip);
fs/gfs2/rgrp.c +4 -3
@@ -332,9 +332,6 @@ struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk, bool exact)struct rb_node *n, *next;struct gfs2_rgrpd *cur; -if (gfs2_rindex_update (sdp)) -return NULL ; -spin_lock (&sdp->sd_rindex_spin); n = sdp->sd_rindex_tree.rb_node;while (n) {
@@ -928,6 +925,10 @@ int gfs2_fitrim(struct file *filp, void __user *argp) }else if (copy_from_user (&r, argp,sizeof (r)))return -EFAULT ; + ret =gfs2_rindex_update (sdp); +if (ret) +return ret; + rgd =gfs2_blk2rgrpd (sdp, r.start,0 ); rgd_end =gfs2_blk2rgrpd (sdp, r.start + r.len,0 );
fs/gfs2/xattr.c +12 -0
@@ -238,6 +238,10 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,unsigned int x;int error; + error =gfs2_rindex_update (sdp); +if (error) +return error; +if (GFS2_EA_IS_STUFFED (ea))return 0 ;
@@ -1330,6 +1334,10 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)unsigned int x;int error; + error =gfs2_rindex_update (sdp); +if (error) +return error; +memset (&rlist,0 ,sizeof (struct gfs2_rgrp_list )); error =gfs2_meta_read (ip->i_gl, ip->i_eattr,DIO_WAIT , &indbh);
@@ -1439,6 +1447,10 @@ static int ea_dealloc_block(struct gfs2_inode *ip)struct gfs2_holder gh;int error; + error =gfs2_rindex_update (sdp); +if (error) +return error; + rgd =gfs2_blk2rgrpd (sdp, ip->i_eattr,1 );if (!rgd) {gfs2_consist_inode (ip);
Signature · 1 line
1.7.4
PATCH 4/4 GFS2: Allow caching of rindex glock
In reply to Steven WhitehouseFrom: Bob Peterson <[email protected]>
This patch allows caching of the rindex glock. We were previously setting the GL_NOCACHE bit when the glock was released. That forced the rindex inode to be invalidated, which caused us to re-read rindex at the next access. However, it caused the glock to be unnecessarily bounced around the cluster. This patch allows the glock to remain cached, but it still causes the rindex to be re-read once it has been written to by gfs2_grow.
Ben and I have tested single-node gfs2_grow cases and I've tested clustered gfs2_grow cases on my four-node cluster.
fs/gfs2/aops.c +2 -2
@@ -807,7 +807,7 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,if (inode == sdp->sd_rindex) {adjust_fs_space (inode); - ip->i_gh.gh_flags |=GL_NOCACHE ; + sdp->sd_rindex_uptodate =0 ; }brelse (dibh);
@@ -873,7 +873,7 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,if (inode == sdp->sd_rindex) {adjust_fs_space (inode); - ip->i_gh.gh_flags |=GL_NOCACHE ; + sdp->sd_rindex_uptodate =0 ; }brelse (dibh);
Signature · 1 line
1.7.4