From owner-freebsd-fs@FreeBSD.ORG Sat Feb 22 09:55:43 2014 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50050D65 for ; Sat, 22 Feb 2014 09:55:43 +0000 (UTC) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [IPv6:2607:f8b0:400c:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A91015C8 for ; Sat, 22 Feb 2014 09:55:42 +0000 (UTC) Received: by mail-ve0-f175.google.com with SMTP id oz11so2331017veb.34 for ; Sat, 22 Feb 2014 01:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Topta8EgZW1hdIe/IJVtkTTyed25RgfzxB6DlR/O4vg=; b=i8XLfmHVbi0/JymlwYLl3ef3NfiH7+vnhrQKDxbiZQ9EpZBd4FkvzHvDBLUwDUPLXI sAaPzCfTpdyNXoTf8K1+Or/poMZsgcZSVi4cL8J1/FvjJdNzqJ0y4Zssdwyvk6RQIFT5 PaZCrYud8pvPIPEedXW7CBoG1UsB+w5FwAW8VjA7ut4i+2KPlVcHqZwXW1+mHZJ0cplB cxAAmMWPARYaAxsAXylFj1y6ez7loWB57tfHIjEILr3U0sKrHAa6/XVNQ4/R4WwyvaPs tNyhyCKA9t5XsBLB4j9tKyPofbAnyaqvV8e44QD4Tma4fbBdDIaRavI3C+s5OizRlgm9 Hiag== X-Received: by 10.52.191.9 with SMTP id gu9mr6325372vdc.37.1393062942112; Sat, 22 Feb 2014 01:55:42 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.58.181.134 with HTTP; Sat, 22 Feb 2014 01:55:01 -0800 (PST) In-Reply-To: <201402211654.s1LGsAAi037242@chez.mckusick.com> References: <201402211654.s1LGsAAi037242@chez.mckusick.com> From: Ivan Voras Date: Sat, 22 Feb 2014 10:55:01 +0100 X-Google-Sender-Auth: EReitgzfjbJ9UP5i8_o5rIoywPc Message-ID: Subject: Re: su-journal and lost+found sharing inodes? To: Kirk McKusick Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: freebsd-fs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 09:55:43 -0000 On 21 February 2014 17:54, Kirk McKusick wrote: > > To: freebsd-fs@freebsd.org > > From: Ivan Voras > > Subject: su-journal and lost+found sharing inodes? > > Date: Fri, 21 Feb 2014 12:15:03 +0100 > > > > After a crash which required manual fsck, I've enabled SUJ and rebooted. > > Everything seemed fine until I (as a part of normal, unrelated work) > > noticed that "lost+found" is not a file. But the details are very > curious: > > > > (ls -ali) > > > > 3 drwxrwxr-x 2 root operator 512 Jan 17 14:25 .snap/ > > 4 -r-------- 1 root wheel 33554432 Feb 21 10:29 .sujournal > > 4 -r-------- 1 root wheel 33554432 Feb 21 10:29 lost+found > > > > Am I seeing what I think I'm seeing? lost+found sharing an inode with > > .sujournal, but the hardlink count staying "1" for both files? > > > > SUJ was enabled after a fsck -y run on the file system. > > That is wrong. You will need to run fsck -f to force it to do a full > fsck on the filesystem to get that cleaned up. Journalling (like all > journalling systems) only fixes things that break while it is running. > It does not fix up pre-existing conditions. Note that fsck -y does not > always make good decision on how to handle things. It is really designed > as a last-ditch effort to recover the filesystem. > I didn't want to suggest that journaling would fix anything, I was describing the sequence of operations I did: first fsck -y then turning on journaling - the inode mixup could have happened either in fsck or in tunefs where it re-used an inode which it shouldn't have.