Skip to content

Commit

Permalink
dbuf_free_range() overzealously frees dbufs
Browse files Browse the repository at this point in the history
When called to free a spill block from a dnode, dbuf_free_range() has a
bug that results in all dbufs for the dnode getting freed.  A variety of
problems may result from this bug, but a common one was a zap lookup
tripping an ASSERT because the zap buffers had been zeroed out.  This
could happen on a dataset with xattr=sa set when extended attributes are
written and removed on a directory concurrently with I/O to files in
that directory.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Fixes #3195
Fixes #3222
  • Loading branch information
nedbass committed Mar 25, 2015
1 parent 7b4536c commit 722119f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions module/zfs/dbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,8 @@ dbuf_free_range(dnode_t *dn, uint64_t start, uint64_t end, dmu_tx_t *tx)
continue;
if ((db->db_blkid < start || db->db_blkid > end) && !freespill)
continue;
if (freespill && db->db_blkid != DMU_SPILL_BLKID)
continue;

/* found a level 0 buffer in the range */
mutex_enter(&db->db_mtx);
Expand Down

0 comments on commit 722119f

Please sign in to comment.