diff options
-rw-r--r-- | fs/gfs2/rgrp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 96bd6d759f29..a1a815b691cd 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -978,7 +978,7 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked) | |||
978 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 978 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
979 | struct gfs2_rgrpd *rgd, *begin = NULL; | 979 | struct gfs2_rgrpd *rgd, *begin = NULL; |
980 | struct gfs2_alloc *al = ip->i_alloc; | 980 | struct gfs2_alloc *al = ip->i_alloc; |
981 | int error, rg_locked; | 981 | int error, rg_locked, flags = LM_FLAG_TRY; |
982 | int loops = 0; | 982 | int loops = 0; |
983 | 983 | ||
984 | if (ip->i_rgd && rgrp_contains_block(ip->i_rgd, ip->i_goal)) | 984 | if (ip->i_rgd && rgrp_contains_block(ip->i_rgd, ip->i_goal)) |
@@ -997,7 +997,7 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked) | |||
997 | error = 0; | 997 | error = 0; |
998 | } else { | 998 | } else { |
999 | error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, | 999 | error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, |
1000 | LM_FLAG_TRY, &al->al_rgd_gh); | 1000 | flags, &al->al_rgd_gh); |
1001 | } | 1001 | } |
1002 | switch (error) { | 1002 | switch (error) { |
1003 | case 0: | 1003 | case 0: |
@@ -1012,8 +1012,10 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked) | |||
1012 | /* fall through */ | 1012 | /* fall through */ |
1013 | case GLR_TRYFAILED: | 1013 | case GLR_TRYFAILED: |
1014 | rgd = gfs2_rgrpd_get_next(rgd); | 1014 | rgd = gfs2_rgrpd_get_next(rgd); |
1015 | if (rgd == begin) | 1015 | if (rgd == begin) { |
1016 | flags = 0; | ||
1016 | loops++; | 1017 | loops++; |
1018 | } | ||
1017 | break; | 1019 | break; |
1018 | default: | 1020 | default: |
1019 | return error; | 1021 | return error; |