From patchwork Sat Jan 24 09:06:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 5698791 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6427F9F357 for ; Sat, 24 Jan 2015 09:06:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67CFA20254 for ; Sat, 24 Jan 2015 09:06:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B90020221 for ; Sat, 24 Jan 2015 09:06:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752436AbbAXJGm (ORCPT ); Sat, 24 Jan 2015 04:06:42 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:38577 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbbAXJGk (ORCPT ); Sat, 24 Jan 2015 04:06:40 -0500 Received: by mail-pa0-f44.google.com with SMTP id rd3so1955313pab.3 for ; Sat, 24 Jan 2015 01:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=Gda0wE+qZKQf9+FsMapynEC0i5xfsc1dYdMdFpr+4yo=; b=ViKuKCS6cPVPAYFNmpj6/z1RaNtDlE0HgIod9aldk3Faib053LIQg2Qm1XWj/OYMzY 0GKOaGvDPbA+wBZM9D5ZcwNkvEikdxdvtTbcQ5yP8Hkvbg0iUe/EUxm+utOA2a5AWDYa coxW7VuhU8F5ejqkW1DB4Qk3LN8SQsDgaD0QXakO3BIIix9o976JhcCGAFb3NmXjmJKd j5FRh450OskKg3xKEARtmh82erSQ+6zTuE9CzgBUinbzwI3zzEhLIOSU1uCn4smOHkcu 0euMjM4ay2sNzsx4WJT7CUFs3piEnIu/lfBNl8vcadwCqpybjYbhIdjvsmfqZsl/QTdo Ulig== X-Received: by 10.66.236.36 with SMTP id ur4mr17790804pac.107.1422090399679; Sat, 24 Jan 2015 01:06:39 -0800 (PST) Received: from [10.3.2.10] ([173.224.223.119]) by mx.google.com with ESMTPSA id l11sm4150553pdn.46.2015.01.24.01.06.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jan 2015 01:06:38 -0800 (PST) Message-ID: <54C36091.4000509@gmail.com> Date: Sat, 24 Jan 2015 17:06:25 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jaegeuk Kim CC: linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Subject: [PATCH] f2fs: fix a bug of inheriting default ACL from parent Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Introduced by a6dda0e63e97122ce9e0ba04367e37cca28315fa "f2fs: use generic posix ACL infrastructure". When testing default acl, gets in recent kernel (3.19.0-rc5), # setfacl -dm g:root:rwx test/ # getfacl test/ # file: test/ # owner: root # group: root user::rwx group::r-x other::r-x default:user::rwx default:group::r-x default:group:root:rwx default:mask::rwx default:other::r-x # cd test/ # mkdir testdir ]# getfacl testdir/ # file: testdir/ # owner: root # group: root user::rwx group::rwx // missing an acl "group:root:rwx" inherited from parent other::r-x default:user::rwx default:group::r-x default:group:root:rwx default:mask::rwx default:other::r-x Signed-off-by: Kinglong Mee Reviewed-by: Chao Yu --- fs/f2fs/acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) posix_acl_release(acl); diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index 1ccb26b..b0b23578 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c @@ -396,7 +396,7 @@ int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage, posix_acl_release(default_acl); } if (acl) { - if (error) + if (!error) error = __f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl, ipage);