performance/write-behind: NULL pointer passed to a nonnull parameter
Problem: wb_directory_inode->lock can be null. Solution: added a condition, if(!wb_directory_inode->lock.spinlock) to address the issue (checked one of the attributes of union lock to ensure that union is not null). Updates: bz#1622665 Change-Id: I0749ee16aa2c23f51d4b4c7b0979d494bcd4d90e Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
This commit is contained in:
parent
23e96fd93c
commit
807ec72d74
@ -2471,6 +2471,9 @@ wb_mark_readdirp_start(xlator_t *this, inode_t *directory)
|
||||
|
||||
wb_directory_inode = wb_inode_create(this, directory);
|
||||
|
||||
if (!wb_directory_inode->lock.spinlock)
|
||||
return;
|
||||
|
||||
LOCK(&wb_directory_inode->lock);
|
||||
{
|
||||
GF_ATOMIC_INC(wb_directory_inode->readdirps);
|
||||
@ -2488,6 +2491,9 @@ wb_mark_readdirp_end(xlator_t *this, inode_t *directory)
|
||||
|
||||
wb_directory_inode = wb_inode_ctx_get(this, directory);
|
||||
|
||||
if (!wb_directory_inode->lock.spinlock)
|
||||
return;
|
||||
|
||||
LOCK(&wb_directory_inode->lock);
|
||||
{
|
||||
readdirps = GF_ATOMIC_DEC(wb_directory_inode->readdirps);
|
||||
|
Loading…
x
Reference in New Issue
Block a user