aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-07-24 12:08:53 -0700
committerBrian Behlendorf <[email protected]>2015-07-28 13:30:53 -0700
commitc97d30691c0d599e80370090988a79dd8175b5a8 (patch)
tree840537e53d43e64ee0bf4ee2e305cf8c88b138ae
parent21d41d6806edce8217dfd5d16e74a6a8a4f5fe1b (diff)
Check for NULL in dmu_free_long_range_impl()
A NULL should never be passed as the dnode_t pointer to the function dmu_free_long_range_impl(). Regardless, because we have a reported occurrence of this let's add some error handling to catch this. Better to report a reasonable error to caller than panic the system. Signed-off-by: Brian Behlendorf <[email protected]> Issue #3445
-rw-r--r--module/zfs/dmu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index 7d3945433..eb3bc0ed2 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -644,9 +644,13 @@ static int
dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset,
uint64_t length)
{
- uint64_t object_size = (dn->dn_maxblkid + 1) * dn->dn_datablksz;
+ uint64_t object_size;
int err;
+ if (dn == NULL)
+ return (SET_ERROR(EINVAL));
+
+ object_size = (dn->dn_maxblkid + 1) * dn->dn_datablksz;
if (offset >= object_size)
return (0);