Set bpo->bpo_object = 0 on close to allow retry

During spa_load the spl->spa_deferred_bpobj maybe be opened and closed
multiple times.  It's critical that when the object is closed the
bpo->bpo_object is set to zero to indicate the object is closed.
If it's not during spl_load_retry the spl->spa_deferred_bpobj can
be closes twice resulting in a NULL deref.

This appears to have been fixed upstream the same way.
This commit is contained in:
Brian Behlendorf 2010-08-03 15:56:29 -07:00
parent b3c82b1b18
commit 3253b39fa6
3 changed files with 12 additions and 0 deletions

1
.topdeps Normal file
View File

@ -0,0 +1 @@
master

10
.topmsg Normal file
View File

@ -0,0 +1,10 @@
From: Brian Behlendorf <behlendorf1@llnl.gov>
Subject: [PATCH] fix bpobj_close
During spa_load the spl->spa_deferred_bpobj maybe be opened and closed
multiple times. It's critical that when the object is closed the
bpo->bpo_object is set to zero to indicate the object is closed.
If it's not during spl_load_retry the spl->spa_deferred_bpobj can
be closes twice resulting in a NULL deref.
This appears to have been fixed upstream the same way.

View File

@ -140,6 +140,7 @@ bpobj_close(bpobj_t *bpo)
bpo->bpo_dbuf = NULL; bpo->bpo_dbuf = NULL;
bpo->bpo_phys = NULL; bpo->bpo_phys = NULL;
bpo->bpo_cached_dbuf = NULL; bpo->bpo_cached_dbuf = NULL;
bpo->bpo_object = 0;
mutex_destroy(&bpo->bpo_lock); mutex_destroy(&bpo->bpo_lock);
} }