From patchwork Fri Feb 14 05:29:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guangliang Zhao X-Patchwork-Id: 3650001 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A59CDBF13A for ; Fri, 14 Feb 2014 05:30:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C506A20218 for ; Fri, 14 Feb 2014 05:30:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECC8820213 for ; Fri, 14 Feb 2014 05:30:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbaBNFaD (ORCPT ); Fri, 14 Feb 2014 00:30:03 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:43392 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751740AbaBNFaB (ORCPT ); Fri, 14 Feb 2014 00:30:01 -0500 Received: by mail-pb0-f47.google.com with SMTP id rp16so11881628pbb.20 for ; Thu, 13 Feb 2014 21:30:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mm6Vk/qjcOHUixDCKyie38GXj2pafGcvdvPoDk0d3tk=; b=X7rJ49FaLvTzMI73OvhLmT9i3x7FIKoyLQjSZomibB8+dQTaJxk8Htds5tVRmAnp8q pxTTSJaJhL1NuS0KN0WFpFx+RYMxS8N/f10F+chTJEyoYhnkqYe61kufuya6bppC/cAr Qm+tJPz37JmWgYi/enFoChks/0uDkTkXZ4NMKhoSx1L50sHs9EUyqycjeUZq7f0y5eaC fx7tZ6eW94a/L7x1ySXRczq2ckh23cHUMP4UpZ9D5QSde1xP+6YjqDkuyrg65QgvgFSE 2a2/iUUCNBv58kWmWaV80sBmNpVybTCU/yderX+FZuc+XEhI60Mt08IXOI8Lf4DlM4NE i1Hg== X-Received: by 10.68.24.134 with SMTP id u6mr6636227pbf.3.1392355800874; Thu, 13 Feb 2014 21:30:00 -0800 (PST) Received: from localhost ([118.194.208.131]) by mx.google.com with ESMTPSA id nm5sm12769882pbc.29.2014.02.13.21.29.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 13 Feb 2014 21:30:00 -0800 (PST) From: Guangliang Zhao To: ceph-devel@vger.kernel.org Cc: sage@inktank.com Subject: [PATCH 2/3] ceph: add acl, noacl options for cephfs mount Date: Fri, 14 Feb 2014 13:29:43 +0800 Message-Id: <1392355784-10422-3-git-send-email-lucienchao@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392355784-10422-1-git-send-email-lucienchao@gmail.com> References: <1392355784-10422-1-git-send-email-lucienchao@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@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 Signed-off-by: Guangliang Zhao --- fs/ceph/super.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 2df963f..9d65c08 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -144,7 +144,9 @@ enum { Opt_ino32, Opt_noino32, Opt_fscache, - Opt_nofscache + Opt_nofscache, + Opt_acl, + Opt_noacl }; static match_table_t fsopt_tokens = { @@ -172,6 +174,8 @@ static match_table_t fsopt_tokens = { {Opt_noino32, "noino32"}, {Opt_fscache, "fsc"}, {Opt_nofscache, "nofsc"}, + {Opt_acl, "acl"}, + {Opt_noacl, "noacl"}, {-1, NULL} }; @@ -271,6 +275,12 @@ static int parse_fsopt_token(char *c, void *private) case Opt_nofscache: fsopt->flags &= ~CEPH_MOUNT_OPT_FSCACHE; break; + case Opt_acl: + fsopt->sb_flags |= MS_POSIXACL; + break; + case Opt_noacl: + fsopt->sb_flags &= ~MS_POSIXACL; + break; default: BUG_ON(token); } @@ -438,6 +448,11 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root) else seq_puts(m, ",nofsc"); + if (fsopt->sb_flags & MS_POSIXACL) + seq_puts(m, ",acl"); + else + seq_puts(m, ",noacl"); + if (fsopt->wsize) seq_printf(m, ",wsize=%d", fsopt->wsize); if (fsopt->rsize != CEPH_RSIZE_DEFAULT) @@ -819,9 +834,6 @@ static int ceph_set_super(struct super_block *s, void *data) s->s_flags = fsc->mount_options->sb_flags; s->s_maxbytes = 1ULL << 40; /* temp value until we get mdsmap */ -#ifdef CONFIG_CEPH_FS_POSIX_ACL - s->s_flags |= MS_POSIXACL; -#endif s->s_xattr = ceph_xattr_handlers; s->s_fs_info = fsc; @@ -911,6 +923,10 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type, struct ceph_options *opt = NULL; dout("ceph_mount\n"); + +#ifdef CONFIG_CEPH_FS_POSIX_ACL + flags |= MS_POSIXACL; +#endif err = parse_mount_options(&fsopt, &opt, flags, data, dev_name, &path); if (err < 0) { res = ERR_PTR(err);