]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gfs2: handle NULL rgd in set_rgrp_preferences
authorAbhi Das <adas@redhat.com>
Tue, 5 May 2015 16:26:04 +0000 (11:26 -0500)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 29 May 2017 20:44:32 +0000 (16:44 -0400)
commit7dc1eadc69ed28426e954d9681a95ec0a00e54d8
tree3feb3970fbc821ff3d3ff0d91b01ff57b782efb6
parent3dae09ee1fb2ce7d62b2f28b8d7945aad320ea6a
gfs2: handle NULL rgd in set_rgrp_preferences

The function set_rgrp_preferences() does not handle the (rarely
returned) NULL value from gfs2_rgrpd_get_next() and this patch
fixes that.

The fs image in question is only 150MB in size which allows for
only 1 rgrp to be created. The in-memory rb tree has only 1 node
and when gfs2_rgrpd_get_next() is called on this sole rgrp, it
returns NULL. (Default behavior is to wrap around the rb tree and
return the first node to give the illusion of a circular linked
list. In the case of only 1 rgrp, we can't have
gfs2_rgrpd_get_next() return the same rgrp (first, last, next all
point to the same rgrp)... that would cause unintended consequences
and infinite loops.)

orabug: 25253085
Orabug: 25791662

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
(cherry picked from upstream commit 959b6717175713259664950f3bba2418b038f69a)
Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
fs/gfs2/rgrp.c