From patchwork Thu Jul 27 03:13:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ernesto_A=2E_Fern=C3=A1ndez?= X-Patchwork-Id: 9866241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8016560382 for ; Thu, 27 Jul 2017 03:14:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B42B2074F for ; Thu, 27 Jul 2017 03:14:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DABE27FB0; Thu, 27 Jul 2017 03:14:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F03CC2074F for ; Thu, 27 Jul 2017 03:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751471AbdG0DOA (ORCPT ); Wed, 26 Jul 2017 23:14:00 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:37524 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbdG0DOA (ORCPT ); Wed, 26 Jul 2017 23:14:00 -0400 Received: by mail-qk0-f196.google.com with SMTP id x77so2550517qka.4 for ; Wed, 26 Jul 2017 20:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ytVQNj/AW0bjsnyNI0clKTebDD+KBo15iHuF+VueM40=; b=T5+tej9xXf47EboHKH16R+MHfqnlWpfalRU4NYudQFwkifIIeW0p8XiJCVon0tuBSr 3aFrsj5DJlFLbzUsy1DUaTTkABsmL4c+mWGvnnC+jv5ZvXYEF7MvzfX7Y/z62KujFhd+ G7kmiSx3ejDiLvUjhIF6QdXYn5njMV9kAbBLk0awa72PsHor5tA+kiPh+deHAV1VrYs9 3HAKy0JbS2aFrUtqO/QVrS7zkYaLFJPNG360gJLeOB0lPTpGOVZkHcUSP5RETwu+r/9Y A+RVtKWcX0/KSa/CfvJ9taKRWRyD9XcRiXyHfWclcy6Xzw23X1fRm6KJNHdsK6Cq/zPx ca/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ytVQNj/AW0bjsnyNI0clKTebDD+KBo15iHuF+VueM40=; b=G7d6yMTtDobTaRL551xf2+maSPUmsKW5WETg168xholziGdiq8BccQQLUgTq8VR/8q 5tHsZoVFJcXqJTGL0f178QLNb0jKvPAio/+Y1HT1XkszYBgayNW9wahsBvZ3pbJDIx9y Z0N2se5qzJ1Hyt2rnTGyFE3GD5akkUPr1Zw+QO5R1pgJBiq28qCEweOnNAm9TgBTYSQK JbEA3cj85OS44ffF3KkYJXeiI4Cb7WT/MQfSsRRnC/04jB917Lio21Zc2D+0EgzN90/s DKhYIxGZqe0XMfJI80xwJTXs9ZnoCVcDrNr8DEw+L8SaZ8hSkl96TsyWnQbkBkks8BXs A91A== X-Gm-Message-State: AIVw110n+DpcHuiV5aXDC+2IBwFqoDxLF+RVuT+gy5g/JBAWzCPG5ToU QE1pCgckD34zGPcA X-Received: by 10.55.104.16 with SMTP id d16mr3757218qkc.43.1501125239184; Wed, 26 Jul 2017 20:13:59 -0700 (PDT) Received: from debian.home ([190.19.104.98]) by smtp.gmail.com with ESMTPSA id 58sm13396184qtu.88.2017.07.26.20.13.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jul 2017 20:13:58 -0700 (PDT) Date: Thu, 27 Jul 2017 00:13:54 -0300 From: Ernesto =?utf-8?Q?A=2E_Fern=C3=A1ndez?= To: linux-fsdevel@vger.kernel.org Cc: Jan Kara , Andreas Gruenbacher , Alexander Viro , Ernesto =?utf-8?Q?A=2E_Fern=C3=A1ndez?= Subject: [PATCH 2/2] hfsplus: add mount option to enable ACL support Message-ID: <7f2987dd3b8eace03dece289d35011ef65170c11.1501124092.git.ernesto.mnd.fernandez@gmail.com> References: <4d0758dad0ee32bda49113a957a8b5d9ce882e9b.1501124092.git.ernesto.mnd.fernandez@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4d0758dad0ee32bda49113a957a8b5d9ce882e9b.1501124092.git.ernesto.mnd.fernandez@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The hfsplus module already has the code to support access control lists, but there is no corresponding mount option. Add it and keep it disabled by default. Signed-off-by: Ernesto A. Fernández Reviewed-by: Jan Kara --- Documentation/filesystems/hfsplus.txt | 4 ++++ fs/hfsplus/hfsplus_fs.h | 1 + fs/hfsplus/options.c | 15 ++++++++++++++- fs/hfsplus/super.c | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Documentation/filesystems/hfsplus.txt b/Documentation/filesystems/hfsplus.txt index 59f7569..83670ac 100644 --- a/Documentation/filesystems/hfsplus.txt +++ b/Documentation/filesystems/hfsplus.txt @@ -43,6 +43,10 @@ When mounting an HFSPlus filesystem, the following options are accepted: nodecompose Do not decompose file name characters. + acl + Enable POSIX Access Control Lists support, disabled by default. + Requires CONFIG_HFSPLUS_FS_POSIX_ACL set in the kernel configuration. + force Used to force write access to volumes that are marked as journalled or locked. Use at your own risk. diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index a3f03b2..8bc78c1 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -153,6 +153,7 @@ struct hfsplus_sb_info { struct inode *alloc_file; struct inode *hidden_dir; struct nls_table *nls; + struct super_block *sb; /* Runtime variables */ u32 blockoffset; diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c index bb806e5..6f8b5a9 100644 --- a/fs/hfsplus/options.c +++ b/fs/hfsplus/options.c @@ -24,7 +24,7 @@ enum { opt_part, opt_session, opt_nls, opt_nodecompose, opt_decompose, opt_barrier, opt_nobarrier, - opt_force, opt_err + opt_force, opt_acl, opt_err }; static const match_table_t tokens = { @@ -41,6 +41,7 @@ static const match_table_t tokens = { { opt_barrier, "barrier" }, { opt_nobarrier, "nobarrier" }, { opt_force, "force" }, + { opt_acl, "acl" }, { opt_err, NULL } }; @@ -195,6 +196,14 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi) case opt_force: set_bit(HFSPLUS_SB_FORCE, &sbi->flags); break; + case opt_acl: +#ifdef CONFIG_HFSPLUS_FS_POSIX_ACL + sbi->sb->s_flags |= MS_POSIXACL; + break; +#else + pr_err("support for ACL not compiled in!"); + return 0; +#endif default: return 0; } @@ -234,5 +243,9 @@ int hfsplus_show_options(struct seq_file *seq, struct dentry *root) seq_puts(seq, ",nodecompose"); if (test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags)) seq_puts(seq, ",nobarrier"); +#ifdef CONFIG_HFSPLUS_FS_POSIX_ACL + if (sbi->sb->s_flags & MS_POSIXACL) + seq_puts(seq, ",acl"); +#endif return 0; } diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 67aedf4..258fb86 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -389,6 +389,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) goto out; sb->s_fs_info = sbi; + sbi->sb = sb; mutex_init(&sbi->alloc_mutex); mutex_init(&sbi->vh_mutex); spin_lock_init(&sbi->work_lock);