diff options
author | Brian Behlendorf <[email protected]> | 2020-02-10 14:54:12 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-10 14:54:12 -0800 |
commit | dceeca5bbd00188e7dcb1cf66080dcf2a0b47601 (patch) | |
tree | 4548204c167c2b38fd888229ffc4c8407b18a6e0 | |
parent | bc67cba7c0f8b860746b3c80251fc8a968600d61 (diff) |
Add missing dmu_buf_unlock_parent() calls to dbuf_read_impl()
As explained by the comment in dbuf_read() and above dbuf_read_impl().
Under all circumstances the parent lock specified by dblt should be
dropped when existing dbuf_read_impl(). This was not being done for
two exist paths. Additionally, ensure the mutex is unlocked before
dropping the parent lock.
Reviewed-by: Paul Dagnelie <[email protected]>
Reviewed-by: Igor Kozhukhov <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9968
-rw-r--r-- | module/zfs/dbuf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index 02478605f..0256f3a4c 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -1321,6 +1321,7 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags, if (err != 0) { DB_DNODE_EXIT(db); mutex_exit(&db->db_mtx); + dmu_buf_unlock_parent(db, dblt, tag); return (err); } @@ -1390,6 +1391,7 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags, SPA_FEATURE_REDACTED_DATASETS)); DB_DNODE_EXIT(db); mutex_exit(&db->db_mtx); + dmu_buf_unlock_parent(db, dblt, tag); return (SET_ERROR(EIO)); } @@ -1414,8 +1416,8 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags, err = dbuf_read_verify_dnode_crypt(db, flags); if (err != 0) { DB_DNODE_EXIT(db); - dmu_buf_unlock_parent(db, dblt, tag); mutex_exit(&db->db_mtx); + dmu_buf_unlock_parent(db, dblt, tag); return (err); } |