From patchwork Sat Feb 16 12:56:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 2151701 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C8A14DF2A1 for ; Sat, 16 Feb 2013 12:57:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753144Ab3BPM5E (ORCPT ); Sat, 16 Feb 2013 07:57:04 -0500 Received: from linux-libre.fsfla.org ([208.118.235.54]:59116 "EHLO linux-libre.fsfla.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753068Ab3BPM5D (ORCPT ); Sat, 16 Feb 2013 07:57:03 -0500 Received: from freie (home.lxoliva.fsfla.org [172.31.160.22]) by linux-libre.fsfla.org (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id r1GCv0vG007511 for ; Sat, 16 Feb 2013 12:57:01 GMT Received: from livre.home (livre.home [172.31.160.2]) by freie (8.14.6/8.14.6) with ESMTP id r1GCue6C013123; Sat, 16 Feb 2013 10:56:43 -0200 From: Alexandre Oliva To: ceph-devel@vger.kernel.org Subject: mds crashes upon access to some snapshotted files Organization: Free thinker, not speaking for the GNU Project Date: Sat, 16 Feb 2013 10:56:38 -0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org 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 If we can't find oldparent, skip creating the snapshot. Signed-off-by: Alexandre Oliva --- 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 &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),