Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for proposing the patch. The thing is
strfree(NULL)
should be safe except for very old versions of ZoL. It callskfree()
which is handled properly even by 2.6.32 era kernels. Are you able to reproduce this issue reliably?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is to be,
I have add a log to zfs_allow_log_destroy function and zfs_ioc_log_history function.
void
zfs_allow_log_destroy(void *arg)
{
char *poolname = arg;
if(NULL != poolname)
{
printk("heary-cao zfs_allow_log_destroy----------> poolname is %s\n",poolname);
strfree(poolname);
}
else
{
printk("heary-cao zfs_allow_log_destroy----------> poolname is NULL\n");
}
}
zfs_ioc_log_history:
poolname = tsd_get(zfs_allow_log_key);
if(poolname == NULL)
{
printk("heary-cao zfs_ioc_log_history ------>tsd_get error\n");
return (SET_ERROR(EINVAL));
}
else
{
printk("heary-cao zfs_ioc_log_history--->poolname:%s\n",poolname);
}
run zfs test suite:
[/opt/ztest/zfs-tests/tests/functional/cli_root/zdb]
tests = ['zdb_001_neg']
[/opt/ztest/zfs-tests/tests/functional/cli_root/zfs]
tests = ['zfs_001_neg', 'zfs_003_neg']
[/opt/ztest/zfs-tests/tests/functional/cli_root/zfs_create]
tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos',
'zfs_create_006_pos', 'zfs_create_007_pos', 'zfs_create_013_pos']
the log is:
[ 2085.673959] heary-cao zfs_ioc_log_history--->poolname:vd-F0703B79-EBB9-5B12-6C74-BAE161A49000
[ 2085.683826] heary-cao zfs_allow_log_destroy----------> poolname is NULL