mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
Suppress Clang Static Analyzer warning in dsl_dir_rename_sync()
Clang's static analyzer reports that if we try to rename a root dataset in `dsl_dir_rename_sync()`, we will have a NULL pointer passed to strlcpy(). This is impossible because `dsl_dir_rename_check()` will prevent us from doing this. We add an assertion to silence this warning. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14575
This commit is contained in:
parent
17443e0b20
commit
45c446308a
@ -2125,6 +2125,8 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t *tx)
|
||||
VERIFY0(dsl_dir_hold(dp, ddra->ddra_newname, FTAG, &newparent,
|
||||
&mynewname));
|
||||
|
||||
ASSERT3P(mynewname, !=, NULL);
|
||||
|
||||
/* Log this before we change the name. */
|
||||
spa_history_log_internal_dd(dd, "rename", tx,
|
||||
"-> %s", ddra->ddra_newname);
|
||||
|
Loading…
Reference in New Issue
Block a user