From patchwork Mon Apr 15 18:59:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zach Brown X-Patchwork-Id: 2446621 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EC0DA3FD1A for ; Mon, 15 Apr 2013 18:59:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932986Ab3DOS7d (ORCPT ); Mon, 15 Apr 2013 14:59:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18456 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754116Ab3DOS7c (ORCPT ); Mon, 15 Apr 2013 14:59:32 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3FIxVqA003504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Apr 2013 14:59:31 -0400 Received: from localhost (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3FIxQKU026547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 15 Apr 2013 14:59:26 -0400 Date: Mon, 15 Apr 2013 11:59:26 -0700 From: Zach Brown To: Dan McGrath Cc: Jan Alexander Steffens , Eric Sandeen , linux-btrfs@vger.kernel.org Subject: Re: [PATCH] btrfs-progs: No-op when called as fsck.btrfsck Message-ID: <20130415185926.GD16091@lenny.home.zabbo.net> References: <1366033629-25121-1-git-send-email-danmcgrath.ca@gmail.com> <1366033629-25121-2-git-send-email-danmcgrath.ca@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org > Anyways, thought I would reply back with some insight on the matter > and see what others had to say, since I am in no position to dictate > the direction that brtfsck/fsck.btrfs should take as far as wrapper > script or no is concerned. Look forward to your replies! o/ FWIW: debian has been carrying a patch to ignore fsck args to help it run as fsck.btrfs. I think modern versions of their btrfs-tools package that are based on more recent btrfs-progs also include the hunk to recognize being called as fsck.btrfs. It might be worth finding someone who knows the history of the debian package. I'm certainly not that person :). Here's the result of some light googling: http://ftp.de.debian.org/debian/pool/main/b/btrfs-tools/btrfs-tools_0.19+20130131-3+really20121004-1.debian.tar.xz debian/patches/08-fsck.patch: Author: Sten Heinze Description: Ignore all arguments starting with -a in btrfsck for the time being (Closes: #567681, #571300, #612809, #668832). --- 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 diff -Naurp btrfs-tools.orig/btrfsck.c btrfs-tools/btrfsck.c --- btrfs-tools.orig/btrfsck.c 2012-12-10 10:44:57.283351955 +0100 +++ btrfs-tools/btrfsck.c 2012-12-10 10:56:20.971516720 +0100 @@ -3477,6 +3477,12 @@ static void print_usage(void) exit(1); } +static void print_info(void) +{ + fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION); + exit(0); +} + static struct option long_options[] = { { "super", 1, NULL, 's' }, { "repair", 0, NULL, 0 }, @@ -3501,7 +3507,7 @@ int main(int ac, char **av) while(1) { int c; - c = getopt_long(ac, av, "s:", long_options, + c = getopt_long(ac, av, "s:anry", long_options, &option_index); if (c < 0) break; @@ -3514,6 +3520,12 @@ int main(int ac, char **av) break; case '?': print_usage(); + break; + case 'a': + case 'n': + case 'r': + case 'y': + print_info(); } if (option_index == 1) { printf("enabling repair mode\n");