Skip to contentSkip to conversation

sub sd_rgrps When clear rgrp

PATCH In review Yang Bin 2 participants 3 messages Jun 27, 2019 – Jun 28, 2019 GFS2 file system

lore
Share & tools
lore

Yang Bin

author
#0 lore raw

PATCH 1/1 sub sd_rgrps When clear rgrp

From: " Yang Bin "<[email protected]>

When clear rgrp,sub sd_rgrps after erased from rindex_tree

---
 fs/gfs2/rgrp.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/rgrp.c +1 -0
index 15d6e32..a4b2e83
@@ -730,6 +730,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp)
 		gl = rgd->rd_gl;
 
 		rb_erase(n, &sdp->sd_rindex_tree);
+		sdp->sd_rgrps--;
 
 		if (gl) {
 			glock_clear_object(gl, rgd);
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Yang Bin,

Am Do., 27. Juni 2019 um 05:08 Uhr schrieb Yang Bin <[email protected]>:

Quoted 3 lines

From: " Yang Bin "<[email protected]>

When clear rgrp,sub sd_rgrps after erased from rindex_tree

this patch isn't incorrect, but all it does it ensure that sd_rgrps reaches zero before we destroy a struct gfs2_sbd. However, sd_rgrps is only ever used when a filesystem is active, and while that is the case, it can never decrease. It will grow when the filesystem is grown though.

So what are you trying to achieve with this patch?

Quoted 18 lines
---
 fs/gfs2/rgrp.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/rgrp.c +1 -1
index 15d6e32..a4b2e83
@@ -730,6 +730,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp)
                gl = rgd->rd_gl;
 
                rb_erase(n, &sdp->sd_rindex_tree);
+               sdp->sd_rgrps--;
 
                if (gl) {
                        glock_clear_object(gl, rgd);
--
Quoted 2 lines

1.8.3.1

Thanks,
Andreas

#2 lore raw

PATCH 1/1 sub sd_rgrps When clear rgrp

Hi Andreas,

Quoted 5 lines

Am Do., 27. Juni 2019 um 05:08 Uhr schrieb Yang Bin <[email protected]>:

Quoted 3 lines

From: " Yang Bin "<[email protected]>

When clear rgrp,sub sd_rgrps after erased from rindex_tree

Quoted 7 lines

this patch isn't incorrect, but all it does it ensure that sd_rgrps reaches zero before we destroy a struct gfs2_sbd. However, sd_rgrps is only ever used when a filesystem is active, and while that is the case, it can never decrease. It will grow when the filesystem is grown though.

So what are you trying to achieve with this patch?

In mounting, it may fail and then execute "gfs2_clear_rgrpd" . To solve this failing , I add reload process,which will read rindex again .But reload will fail , because sd_rgrps has beyonded rindex`s size. So I make this patch.

Quoted 22 lines
Quoted 18 lines
---
 fs/gfs2/rgrp.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/rgrp.c +1 -1
index 15d6e32..a4b2e83
@@ -730,6 +730,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp)
                gl = rgd->rd_gl;
 
                rb_erase(n, &sdp->sd_rindex_tree);
+               sdp->sd_rgrps--;
 
                if (gl) {
                        glock_clear_object(gl, rgd);
--
Quoted 2 lines

1.8.3.1

Thanks,
Andreas