mds crashes upon access to some snapshotted files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I suppose this might be the result of some filesystem corruption, but I
have some files in my ceph tree that, when accessed, crash the mds.

The files are in subdirectories of dirs snapshotted numerous times, some
very recently, some long ago.  All but the most recent snapshots have
been removed, though.  Anyway, I'm not accessing them through the
snapshot (i.e., not as subdir/.snap/_snapname_inode/filename, but as
subdir/filename).

I've had this problem for quite a long time, and I couldn't quite figure
out what's special about the files, the directories holding them, or
what.  I suspect some corruption from old releases of ceph, that might
or might not still be possible to create with a newer release.

Anyway, long ago I found out this patch would work around the problem,
enabling me to access the files just fine, apparently without any other
bad consequences.

Does it make sense to put it in the upcoming stable release?

Any ideas of what to do to find out why I need this patch, and/or what I
could do to not need this patch any more?

Thanks,

mds: don't crash when missing oldparent

From: Alexandre Oliva <oliva@xxxxxxx>

If we can't find oldparent, skip creating the snapshot.

Signed-off-by: Alexandre Oliva <oliva@xxxxxxx>
---
 src/mds/snap.cc |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mds/snap.cc b/src/mds/snap.cc
index fa434b7..5c104db 100644
--- a/src/mds/snap.cc
+++ b/src/mds/snap.cc
@@ -170,7 +170,8 @@ void SnapRealm::build_snap_set(set<snapid_t> &s,
        p != srnode.past_parents.end() && p->first >= first && p->second.first <= last;
        p++) {
     CInode *oldparent = mdcache->get_inode(p->second.ino);
-    assert(oldparent);  // call open_parents first!
+    if (!oldparent)
+      continue;
     assert(oldparent->snaprealm);
     oldparent->snaprealm->build_snap_set(s, max_seq, max_last_created, max_last_destroyed,
 					 MAX(first, p->second.first),
-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux