Project

General

Profile

Bug #15167

CID 1355575: null CDir* can get pushed on ScrubStack?

Added by Greg Farnum almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
-
Target version:
-
Start date:
03/17/2016
Due date:
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDS
Labels (FS):
Pull request ID:

Description

** CID 1355575:  Null pointer dereferences  (NULL_RETURNS)
/mds/ScrubStack.cc: 148 in ScrubStack::scrub_dir_inode(CInode *, bool *, bool *, bool *)()

________________________________________________________________________________________________________
*** CID 1355575:  Null pointer dereferences  (NULL_RETURNS)
/mds/ScrubStack.cc: 148 in ScrubStack::scrub_dir_inode(CInode *, bool *, bool *, bool *)()
142         dout(20) << __func__ << " iterating over " << scrubbing_frags.size()
143           << " scrubbing frags" << dendl;
144         for (list<frag_t>::iterator i = scrubbing_frags.begin();
145             i != scrubbing_frags.end();
146             ++i) {
147           // turn frags into CDir *
>>>     CID 1355575:  Null pointer dereferences  (NULL_RETURNS)
>>>     Assigning: "dir" = null return value from "get_dirfrag".
148           CDir *dir = in->get_dirfrag(*i);
149           scrubbing_cdirs.push_back(dir);
150           dout(25) << __func__ << " got CDir " << *dir << " presently scrubbing" << dendl;
151         }
152
153 

I think by the time we get here we're supposed to already have those in memory, but check that and do something to make Coverity happy (or fix the bug, if it is one!)

Associated revisions

Revision 9bdf337f (diff)
Added by Yan, Zheng almost 3 years ago

mds: avoid scrubbing (CDir*)NULL

If dirfrags get fragmented in the middle of scrubbing, get_dirfrag()
can return NULL.

Fixes: #15167
Signed-off-by: Yan, Zheng <>

History

#1 Updated by Zheng Yan almost 3 years ago

  • Status changed from New to Need Review

#2 Updated by Greg Farnum almost 3 years ago

  • Status changed from Need Review to Resolved

#3 Updated by Greg Farnum over 2 years ago

  • Component(FS) MDS added

Also available in: Atom PDF