Actions
Bug #20254
closedmds: coverity error in Server::_rename_prepare
Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Code Hygiene
Target version:
-
% Done:
0%
Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDS
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
** CID 1412578: Null pointer dereferences (FORWARD_NULL) /home/brad/working/src/ceph/src/mds/Server.cc: 7032 in Server::_rename_prepare(boost::intrusive_ptr<MDRequestImpl> &, EMetaBlob *, ceph::buffer::list *, CDentry *, CDentry *, CDentry *)() ________________________________________________________________________________________________________ *** CID 1412578: Null pointer dereferences (FORWARD_NULL) /home/brad/working/src/ceph/src/mds/Server.cc: 7032 in Server::_rename_prepare(boost::intrusive_ptr<MDRequestImpl> &, EMetaBlob *, ceph::buffer::list *, CDentry *, CDentry *, CDentry *)() 7026 force_journal_dest = true; 7027 } else 7028 force_journal_dest = _need_force_journal(srci, false); 7029 } 7030 7031 bool force_journal_stray = false; >>> CID 1412578: Null pointer dereferences (FORWARD_NULL) >>> Comparing "straydn" to null implies that "straydn" might be null. 7032 if (oldin && oldin->is_dir() && straydn && !straydn->is_auth()) 7033 force_journal_stray = _need_force_journal(oldin, true); 7034 7035 if (linkmerge) 7036 dout(10) << " merging remote and primary links to the same inode" << dendl; 7037 if (silent)
From Brad Hubbard's static analysis roundup.
Looks like Coverity is complaining that we do a straydn NULL check here but later in the function do not check for NULL. I'm not sure if Coverity is smart enough to understand the assert(straydn) calls where we assume it cannot be NULL. There are three cases where we don't do the assert:
https://github.com/ceph/ceph/blob/9f259cb923e7474229bb2e5e54b59f3b7f068bc5/src/mds/Server.cc#L7164
https://github.com/ceph/ceph/blob/9f259cb923e7474229bb2e5e54b59f3b7f068bc5/src/mds/Server.cc#L7184-L7194
https://github.com/ceph/ceph/blob/9f259cb923e7474229bb2e5e54b59f3b7f068bc5/src/mds/Server.cc#L7278
Updated by Patrick Donnelly almost 7 years ago
- Status changed from New to Fix Under Review
Updated by Patrick Donnelly almost 7 years ago
- Status changed from Fix Under Review to Resolved
Actions