From patchwork Tue May 18 00:51:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shi Weihua X-Patchwork-Id: 100284 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4I0qIPX027582 for ; Tue, 18 May 2010 00:52:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756066Ab0ERAwC (ORCPT ); Mon, 17 May 2010 20:52:02 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:52953 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756037Ab0ERAwA (ORCPT ); Mon, 17 May 2010 20:52:00 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 95127170118; Tue, 18 May 2010 08:51:58 +0800 (CST) Received: from fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id o4I0nv0v003974; Tue, 18 May 2010 08:49:57 +0800 Received: from [10.167.141.106] (unknown [10.167.141.106]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 06D3010C00A; Tue, 18 May 2010 08:55:31 +0800 (CST) Message-ID: <4BF1E4AA.9090709@cn.fujitsu.com> Date: Tue, 18 May 2010 08:51:54 +0800 From: Shi Weihua User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: chris.mason@oracle.com, "Yan, Zheng" CC: linux-btrfs@vger.kernel.org, LKML Subject: [PATCH] btrfs: prohibit a operation of changing acl's mask when noacl mount option used Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 18 May 2010 00:52:18 +0000 (UTC) diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index da3133c..f2e09c2 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c @@ -159,6 +159,9 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type, int ret; struct posix_acl *acl = NULL; + if (!IS_POSIXACL(inode)) + return -EOPNOTSUPP; + if (value) { acl = posix_acl_from_xattr(value, size); if (acl == NULL) {