All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] GFS2: make sure rgrps are up to date in func gfs2_blk2rgrpd
       [not found] <18c4c636-5326-4710-aa06-33ff3a532d30@zmail12.collab.prod.int.phx2.redhat.com>
@ 2012-03-05 15:19 ` Bob Peterson
  2012-03-05 16:25   ` Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2012-03-05 15:19 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

This patch adds a call to gfs2_rindex_update from function gfs2_blk2rgrpd
and removes calls to it that are made redundant by it. The problem is
that a gfs2_grow can add rgrps to the rindex, then put those rgrps into
use, thus rendering the rindex we read in at mount time incomplete.

Regards,

Bob Peterson
Red Hat File Systems

Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
--
GFS2: make sure rgrps are up to date in func gfs2_blk2rgrpd

This patch adds a call to gfs2_rindex_update from function gfs2_blk2rgrpd
and removes calls to it that are made redundant by it. The problem is
that a gfs2_grow can add rgrps to the rindex, then put those rgrps into
use, thus rendering the rindex we read in at mount time incomplete.
--
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 6ff9f17..19bde40 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -332,6 +332,9 @@ 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) {
@@ -917,10 +920,6 @@ int gfs2_fitrim(struct file *filp, void __user *argp)
 	if (!blk_queue_discard(q))
 		return -EOPNOTSUPP;
 
-	ret = gfs2_rindex_update(sdp);
-	if (ret)
-		return ret;
-
 	if (argp == NULL) {
 		r.start = 0;
 		r.len = ULLONG_MAX;
@@ -1671,13 +1670,8 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)
 {
 	struct gfs2_rgrpd *rgd;
 	struct gfs2_holder rgd_gh;
-	int error;
-
-	error = gfs2_rindex_update(sdp);
-	if (error)
-		return error;
+	int error = -EINVAL;
 
-	error = -EINVAL;
 	rgd = gfs2_blk2rgrpd(sdp, no_addr, 1);
 	if (!rgd)
 		goto fail;



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

* [Cluster-devel] [GFS2 PATCH] GFS2: make sure rgrps are up to date in func gfs2_blk2rgrpd
  2012-03-05 15:19 ` [Cluster-devel] [GFS2 PATCH] GFS2: make sure rgrps are up to date in func gfs2_blk2rgrpd Bob Peterson
@ 2012-03-05 16:25   ` Steven Whitehouse
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2012-03-05 16:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Now in the -nmw git tree. Thanks,

Steve.

On Mon, 2012-03-05 at 10:19 -0500, Bob Peterson wrote:
> Hi,
> 
> This patch adds a call to gfs2_rindex_update from function gfs2_blk2rgrpd
> and removes calls to it that are made redundant by it. The problem is
> that a gfs2_grow can add rgrps to the rindex, then put those rgrps into
> use, thus rendering the rindex we read in at mount time incomplete.
> 
> Regards,
> 
> Bob Peterson
> Red Hat File Systems
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
> --
> GFS2: make sure rgrps are up to date in func gfs2_blk2rgrpd
> 
> This patch adds a call to gfs2_rindex_update from function gfs2_blk2rgrpd
> and removes calls to it that are made redundant by it. The problem is
> that a gfs2_grow can add rgrps to the rindex, then put those rgrps into
> use, thus rendering the rindex we read in at mount time incomplete.
> --
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index 6ff9f17..19bde40 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
> @@ -332,6 +332,9 @@ 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) {
> @@ -917,10 +920,6 @@ int gfs2_fitrim(struct file *filp, void __user *argp)
>  	if (!blk_queue_discard(q))
>  		return -EOPNOTSUPP;
>  
> -	ret = gfs2_rindex_update(sdp);
> -	if (ret)
> -		return ret;
> -
>  	if (argp == NULL) {
>  		r.start = 0;
>  		r.len = ULLONG_MAX;
> @@ -1671,13 +1670,8 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)
>  {
>  	struct gfs2_rgrpd *rgd;
>  	struct gfs2_holder rgd_gh;
> -	int error;
> -
> -	error = gfs2_rindex_update(sdp);
> -	if (error)
> -		return error;
> +	int error = -EINVAL;
>  
> -	error = -EINVAL;
>  	rgd = gfs2_blk2rgrpd(sdp, no_addr, 1);
>  	if (!rgd)
>  		goto fail;
> 




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

end of thread, other threads:[~2012-03-05 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <18c4c636-5326-4710-aa06-33ff3a532d30@zmail12.collab.prod.int.phx2.redhat.com>
2012-03-05 15:19 ` [Cluster-devel] [GFS2 PATCH] GFS2: make sure rgrps are up to date in func gfs2_blk2rgrpd Bob Peterson
2012-03-05 16:25   ` Steven Whitehouse

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.