gfs2: Don't search for unreserved space twice
If gfs2_inplace_reserve has chosen a resource group but it couldn't make a reservation there, there are too many other reservations in that resource group. In that case, don't even try to respect existing reservations in gfs2_alloc_blocks. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
parent
3d39fcd16d
commit
b2598965dc
@ -2384,11 +2384,12 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *nblocks,
|
|||||||
struct gfs2_rbm rbm = { .rgd = ip->i_res.rs_rgd, };
|
struct gfs2_rbm rbm = { .rgd = ip->i_res.rs_rgd, };
|
||||||
u64 block; /* block, within the file system scope */
|
u64 block; /* block, within the file system scope */
|
||||||
u32 minext = 1;
|
u32 minext = 1;
|
||||||
int error;
|
int error = -ENOSPC;
|
||||||
|
|
||||||
gfs2_set_alloc_start(&rbm, ip, dinode);
|
|
||||||
error = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, &minext, &ip->i_res, false);
|
|
||||||
|
|
||||||
|
if (gfs2_rs_active(&ip->i_res)) {
|
||||||
|
gfs2_set_alloc_start(&rbm, ip, dinode);
|
||||||
|
error = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, &minext, &ip->i_res, false);
|
||||||
|
}
|
||||||
if (error == -ENOSPC) {
|
if (error == -ENOSPC) {
|
||||||
gfs2_set_alloc_start(&rbm, ip, dinode);
|
gfs2_set_alloc_start(&rbm, ip, dinode);
|
||||||
error = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, &minext, NULL, false);
|
error = gfs2_rbm_find(&rbm, GFS2_BLKST_FREE, &minext, NULL, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user