GFS2: Don't skip rgrps for Orlov's sake if reservation is active
PATCH 1/1 GFS2: Don't skip rgrps for Orlov's sake if reservation is active
Hi,
This patch changes function gfs2_inplace_reserve so that it does not perform the Orlov allocator resource group skipping in cases where we have an active reservation. Skipping an active rgrp is improper and gets our block reservation counts out of sync.
Regards,
Bob Peterson
Red Hat File Systems
---
fs/gfs2/rgrp.c +6 -5
@@ -1811,13 +1811,14 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, u32 requested, u32 aflags)if (gfs2_rs_active (rs)) { begin = rs->rs_rbm.rgd; flags =0 ;/* Yoda: Do or do not. There is no try */ - }else if (ip->i_rgd &&rgrp_contains_block (ip->i_rgd, ip->i_goal)) { - rs->rs_rbm.rgd = begin = ip->i_rgd; }else { - rs->rs_rbm.rgd = begin =gfs2_blk2rgrpd (sdp, ip->i_goal,1 ); +if (ip->i_rgd &&rgrp_contains_block (ip->i_rgd, ip->i_goal)) + rs->rs_rbm.rgd = begin = ip->i_rgd; +else + rs->rs_rbm.rgd = begin =gfs2_blk2rgrpd (sdp, ip->i_goal,1 ); +if (S_ISDIR (ip->i_inode.i_mode) && (aflags &GFS2_AF_ORLOV )) + skip =gfs2_orlov_skip (ip); } -if (S_ISDIR (ip->i_inode.i_mode) && (aflags &GFS2_AF_ORLOV )) - skip =gfs2_orlov_skip (ip);if (rs->rs_rbm.rgd ==NULL )return -EBADSLT ;
PATCH 1/1 GFS2: Don't skip rgrps for Orlov's sake if reservation is active
Hi,
I don't think this makes sense... we will never have an active reservation when the orlov allocator is in use, since it is only ever used for new directory inodes,
Steve.
Quoted 38 lines · Bob Peterson
Hi,
This patch changes function
gfs2_inplace_reserveso that it does not perform the Orlov allocator resource group skipping in cases where we have an active reservation. Skipping an active rgrp is improper and gets our block reservation counts out of sync.Regards,
Bob Peterson
Red Hat File SystemsSigned-off-by Bob Peterson <[email protected]>---
fs/gfs2/rgrp.c +6
-5@@ -1811,13 +1811,14 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, u32 requested, u32 aflags)if (gfs2_rs_active (rs)) { begin = rs->rs_rbm.rgd; flags =0 ;/* Yoda: Do or do not. There is no try */ - }else if (ip->i_rgd &&rgrp_contains_block (ip->i_rgd, ip->i_goal)) { - rs->rs_rbm.rgd = begin = ip->i_rgd; }else { - rs->rs_rbm.rgd = begin =gfs2_blk2rgrpd (sdp, ip->i_goal,1 ); +if (ip->i_rgd &&rgrp_contains_block (ip->i_rgd, ip->i_goal)) + rs->rs_rbm.rgd = begin = ip->i_rgd; +else + rs->rs_rbm.rgd = begin =gfs2_blk2rgrpd (sdp, ip->i_goal,1 ); +if (S_ISDIR (ip->i_inode.i_mode) && (aflags &GFS2_AF_ORLOV )) + skip =gfs2_orlov_skip (ip); } -if (S_ISDIR (ip->i_inode.i_mode) && (aflags &GFS2_AF_ORLOV )) - skip =gfs2_orlov_skip (ip);if (rs->rs_rbm.rgd ==NULL )return -EBADSLT ;