From patchwork Thu Jan 16 20:30:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Brandsmeier X-Patchwork-Id: 3500321 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 800E09F32F for ; Thu, 16 Jan 2014 20:30:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8697220172 for ; Thu, 16 Jan 2014 20:30:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CBA6020171 for ; Thu, 16 Jan 2014 20:30:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751906AbaAPUaq (ORCPT ); Thu, 16 Jan 2014 15:30:46 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:43706 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751400AbaAPUaa (ORCPT ); Thu, 16 Jan 2014 15:30:30 -0500 Received: by mail-pb0-f47.google.com with SMTP id um1so3133613pbc.34 for ; Thu, 16 Jan 2014 12:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tFhWrULPEEFZexCNnQCm2JI303RV+2CnEm+Qz5FQfXc=; b=Oge1fQokOI3E8ijqeMN/KImCSpUewGWYndeFSLiuYVcYpnmsosxwjDvasnCzxlcrKa cLUiVLByXCYboulOEyWIb8r6y4Xp3kw8MCDLqgh507ZZnbeoy/PKQrzsC5zu3aUMVkt4 mk6/cSoIwteWgKrSLZIipn6nGUbTMXlxWoxBtZ4jLQalD5D2lxZVwzHZ+P956VnFmbp6 eoCukaRsN61Mo9BNq44yvhpY0CpXxUc+eUB2waJ43+dISAeIINoFZq+YWIXt6B8t76jm 0cI4chLM+brRDMTjIOoXSb+2iU/2/8ZYd8B2bp9glY7CuIX9yKGP58aiIhmKxWyucYSb rgLw== MIME-Version: 1.0 X-Received: by 10.68.236.35 with SMTP id ur3mr12187022pbc.137.1389904230070; Thu, 16 Jan 2014 12:30:30 -0800 (PST) Received: by 10.70.11.163 with HTTP; Thu, 16 Jan 2014 12:30:29 -0800 (PST) In-Reply-To: <20140116121906.GP10639@merlins.org> References: <5A3CA53B-B359-4DE0-A31B-49F98A1EBF7C@colorremedies.com> <20140116121906.GP10639@merlins.org> Date: Thu, 16 Jan 2014 21:30:29 +0100 Message-ID: Subject: Re: btrfsck failes From: Holger Brandsmeier To: Marc MERLIN Cc: Chris Murphy , Btrfs BTRFS , Mitch Harder Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I agree to Marc, I created a small patch to `cmds-check.c` (see attachments). It displays a warning message for 10 seconds if the repair option is enabled. If you think this is a good idea, can someone apply this patch? I am going to roll in my backup soon. Is there anything more that I should give you as a feedback? I did file one bug: https://bugzilla.kernel.org/show_bug.cgi?id=68771 On Thu, Jan 16, 2014 at 1:19 PM, Marc MERLIN wrote: > On Wed, Jan 15, 2014 at 10:16:13AM -0700, Chris Murphy wrote: >> >> On Jan 15, 2014, at 9:15 AM, Mitch Harder wrote: >> >> > On Mon, Jan 13, 2014 at 6:37 PM, Chris Murphy wrote: >> >> >> >> On Jan 13, 2014, at 3:58 PM, Holger Brandsmeier wrote: >> >>> >> >>> Currently btrfsck failes to repair my partition, I get the output: >> >>> >> >>> [root@ho-think bholger]# btrfsck --repair /dev/sda5 >> >> >> >> This is almost the last resort and you probably should be posting to the list before using repair. >> >> >> >> >> > >> > This is like saying: >> > >> > "Yes, btrfs does now have a working btrfsck, but only for the select >> > few who manage to get through on the mailing list for support." >> > >> > I'd like to think that's not the case. >> >> Yet that's exactly what the wiki suggests: "If you have a broken filesystem, it is probably better to use btrfsck with advice from one of the btrfs developers, just in case something goes wrong. (But even if it does go badly wrong, you've still got your backups, right?)" >> >> I think it's understandably annoying that the repair tool could make things worse rather than fail gracefully, because restoring from backups is tedious. But the only way it gets better is if people break both the file system and the repair tools in ways the devs can't possibly predict. > > I hate to be a broken record :) but telling people they should read/have > read a wiki when they are in the middle of fixing a filesystem is not > the right way to go. > On my laptop while travelling, it would even be my only way to boot and > maybe I can't get to the internet until my FS is fixed (maybe, maybe > not, but you get the idea). > > My main point again (sorry) is still that the man page and usage info of btrfsck > should really warn users "this is likely NOT what you want to run, > please read the manpage, or HOWTO in /usr/share/doc/ with details about > mount recovery and other things to try first". > > Think of it as a good thing, it means more btrfs users, and they are > used to working a certain way. It's for btrfs to adapt to how they're > used to working when possible. > > Marc > -- > "A mouse is a device used to point at the xterm you want to type in" - A.S.R. > Microsoft is to operating systems .... > .... what McDonalds is to gourmet cooking > Home page: http://marc.merlins.org/ | PGP 1024R/763BE901 > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --- cmds-check.c +++ cmds-check.c @@ -6427,6 +6427,15 @@ int cmd_check(int argc, char **argv) if (argc != 1) usage(cmd_check_usage); + if (repair != 0) { + printf("\nWARNING: you enabled repair mode, this option could make " + "matters worse for your data. It is recommended to check with the " + "linux-btrfs@vger.kernel.org mailing list before you proceed.\n"); + printf("Sleeping for 10 seconds to give you time to consider..." + " hit ctrl+c if you changed your mind.\n"); + sleep(10); + } + radix_tree_init(); cache_tree_init(&root_cache);