From patchwork Mon May 12 03:04:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guangliang Zhao X-Patchwork-Id: 4155221 X-Patchwork-Delegate: dave@jikos.cz 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 21DDC9F170 for ; Mon, 12 May 2014 03:04:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E7472018B for ; Mon, 12 May 2014 03:04:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C64A2018A for ; Mon, 12 May 2014 03:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbaELDEw (ORCPT ); Sun, 11 May 2014 23:04:52 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:55671 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbaELDEv (ORCPT ); Sun, 11 May 2014 23:04:51 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb1so7365358pad.37 for ; Sun, 11 May 2014 20:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=MXFVJw9MVhd+w4PUesifVU+BO1sZ02WYNURxFXJylHA=; b=SZPo7xoj89yEcfwAIedgi/3IY6aEkP/U2FSFev5uEClvnmm8F7H6c4Ds/IkNZiBLBj ybAjh9pZ6B5wkEJsVazzDf2ID8xO4itQSABA0XiRGXvvjw0JVQcVJfK96OdscVvJeWJa CWW8vOi5R1Qvlu72qlb1S1bVLMfgeQlxE6QkV7HUIYTGUdxOlicn16tGYCYYbc581565 4gBuFwQvcMxJRX5I74JFNS7/LOeYf475Lg0jtw8YdF4JEIvZOjqUED2VtdIqdxM8+I6Q YXRKK/5iqtEbtqM/gmia2tO6s4fduhd84iD75QfZjUenshOP6JzlJ6t/q/jy7uvac+G4 LAhQ== X-Received: by 10.66.139.38 with SMTP id qv6mr50064576pab.123.1399863891441; Sun, 11 May 2014 20:04:51 -0700 (PDT) Received: from localhost ([123.125.124.17]) by mx.google.com with ESMTPSA id pl5sm19973961pbc.90.2014.05.11.20.04.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 11 May 2014 20:04:50 -0700 (PDT) From: Guangliang Zhao To: linux-btrfs@vger.kernel.org Cc: lucienchao@gmail.com Subject: [PATCH v2] Btrfs: remove OPT_acl parse when acl disabled Date: Mon, 12 May 2014 11:04:33 +0800 Message-Id: <1399863873-475-1-git-send-email-lucienchao@gmail.com> X-Mailer: git-send-email 1.7.9.5 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Even CONFIG_BTRFS_FS_POSIX_ACL is not defined, the acl still could been enabled using a mount option, and now fs/btrfs/acl.o is not built, so the mount options will appear to be supported but will be silently ignored. Signed-off-by: Guangliang Zhao Reviewed-by: David Sterba --- V2: return -EINVAL when ACL didn't complied in fs/btrfs/super.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 363404b..1046e66 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -580,8 +580,15 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) } break; case Opt_acl: +#ifdef CONFIG_BTRFS_FS_POSIX_ACL root->fs_info->sb->s_flags |= MS_POSIXACL; break; +#else + btrfs_err(root->fs_info, + "support for ACL not compiled in!"); + ret = -EINVAL; + goto out; +#endif case Opt_noacl: root->fs_info->sb->s_flags &= ~MS_POSIXACL; break;