]> git.karo-electronics.de Git - linux-beck.git/commit
GFS2: Drop inadequate rgrps from the reservation tree
authorBob Peterson <rpeterso@redhat.com>
Wed, 6 Nov 2013 15:58:00 +0000 (10:58 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Fri, 3 Jan 2014 09:57:31 +0000 (09:57 +0000)
commit1330edbeaf304703052fb583dd660b96309e4536
treeed15177cde85caba12da64d7596b7c27377a0a7a
parent5ce13431dd3365d5dd4f3890394dac59b687c0ed
GFS2: Drop inadequate rgrps from the reservation tree

This is just basically a resend of a patch I posted earlier.
It didn't change from its original, except in diff offsets, etc:

This patch fixes a bug in the GFS2 block allocation code. The problem
starts if a process already has a multi-block reservation, but for
some reason, another process disqualifies it from further allocations.
For example, the other process might set on the GFS2_RDF_ERROR bit.
The process holding the reservation jumps to label skip_rgrp, but
that label comes after the code that removes the reservation from the
tree. Therefore, the no longer usable reservation is not removed from
the rgrp's reservations tree; it's lost. Eventually, the lost reservation
causes the count of reserved blocks to get off, and eventually that
causes a BUG_ON(rs->rs_rbm.rgd->rd_reserved < rs->rs_free) to trigger.
This patch moves the call to after label skip_rgrp so that the
disqualified reservation is properly removed from the tree, thus keeping
the rgrp rd_reserved count sane.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/rgrp.c