mirror of
https://github.com/ceph/ceph
synced 2025-03-06 16:28:28 +00:00
mds/Server.cc: fix possible NULL pointer dereference
Assert if straydn is NULL. CID 1019554 (#2 of 2): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null pointer "straydn" to function "MDSCacheObject::is_auth() const", which dereferences it. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
parent
fb222a0a1c
commit
d69290219d
@ -6210,9 +6210,12 @@ void Server::_rename_prepare(MDRequest *mdr,
|
||||
|
||||
// guarantee stray dir is processed first during journal replay. unlink the old inode,
|
||||
// then link the source inode to destdn
|
||||
if (destdnl->is_primary() && straydn->is_auth()) {
|
||||
metablob->add_dir_context(straydn->get_dir());
|
||||
metablob->add_dir(straydn->get_dir(), true);
|
||||
if (destdnl->is_primary()) {
|
||||
assert(straydn);
|
||||
if (straydn->is_auth()) {
|
||||
metablob->add_dir_context(straydn->get_dir());
|
||||
metablob->add_dir(straydn->get_dir(), true);
|
||||
}
|
||||
}
|
||||
|
||||
// sub off target
|
||||
|
Loading…
Reference in New Issue
Block a user