Skip to content

Commit

Permalink
gfs2: Add gfs2_blk2rgrpd comment and fix incorrect use
Browse files Browse the repository at this point in the history
Document when to use gfs2_blk2rgrpd for "inexact" resource group
matching.  Based on that, fix an incorrect use of gfs2_blk2rgrpd in
sweep_bh_for_rgrps.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
  • Loading branch information
Steven Whitehouse authored and Bob Peterson committed Jan 17, 2018
1 parent 1291a0d commit 90bcab9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ static int sweep_bh_for_rgrps(struct gfs2_inode *ip, struct gfs2_holder *rd_gh,
gfs2_assert_withdraw(sdp,
gfs2_glock_is_locked_by_me(rd_gh->gh_gl));
} else {
rgd = gfs2_blk2rgrpd(sdp, bn, false);
rgd = gfs2_blk2rgrpd(sdp, bn, true);
ret = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE,
0, rd_gh);
if (ret)
Expand Down
7 changes: 7 additions & 0 deletions fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,13 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
* @blk: The data block number
* @exact: True if this needs to be an exact match
*
* The @exact argument should be set to true by most callers. The exception
* is when we need to match blocks which are not represented by the rgrp
* bitmap, but which are part of the rgrp (i.e. padding blocks) which are
* there for alignment purposes. Another way of looking at it is that @exact
* matches only valid data/metadata blocks, but with @exact false, it will
* match any block within the extent of the rgrp.
*
* Returns: The resource group, or NULL if not found
*/

Expand Down

0 comments on commit 90bcab9

Please sign in to comment.