From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Venkateswararao Jujjuri (JV)" Subject: [PATCH 2/5] [fs/9p] Initialze cached acls both in cached/uncached mode. Date: Tue, 25 Jan 2011 17:12:27 -0800 Message-ID: <1296004347-25254-1-git-send-email-jvrao@linux.vnet.ibm.com> Cc: linux-fsdevel@vger.kernel.org, "Venkateswararao Jujjuri (JV)" To: v9fs-developer@lists.sourceforge.net Return-path: Received: from e2.ny.us.ibm.com ([32.97.182.142]:54660 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752623Ab1AZAiE (ORCPT ); Tue, 25 Jan 2011 19:38:04 -0500 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p0Q0K5Sn024736 for ; Tue, 25 Jan 2011 19:20:28 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 12D2F728045 for ; Tue, 25 Jan 2011 19:38:03 -0500 (EST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0Q0c2HP119402 for ; Tue, 25 Jan 2011 19:38:02 -0500 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0Q0c1Y6010565 for ; Tue, 25 Jan 2011 17:38:02 -0700 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: With create/mkdir/mknod in non cached mode we initialize the inode using v9fs_get_inode. v9fs_get_inode doesn't initialize the cache inode value to NULL. This is causing to trip on BUG_ON in v9fs_get_cached_acl. Fix is to initialize acls to NULL and not to leave them in ACL_NOT_CACHED state. Signed-off-by: Venkateswararao Jujjuri Reviewed-by: Aneesh Kumar K.V --- fs/9p/acl.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/9p/acl.c b/fs/9p/acl.c index 291ff7b..0a2e480 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c @@ -132,6 +132,10 @@ static int v9fs_set_acl(struct dentry *dentry, int type, struct posix_acl *acl) struct inode *inode = dentry->d_inode; set_cached_acl(inode, type, acl); + + if (!acl) + return 0; + /* Set a setxattr request to server */ size = posix_acl_xattr_size(acl->a_count); buffer = kmalloc(size, GFP_KERNEL); @@ -181,10 +185,8 @@ int v9fs_acl_chmod(struct dentry *dentry) int v9fs_set_create_acl(struct dentry *dentry, struct posix_acl *dpacl, struct posix_acl *pacl) { - if (dpacl) - v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, dpacl); - if (pacl) - v9fs_set_acl(dentry, ACL_TYPE_ACCESS, pacl); + v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, dpacl); + v9fs_set_acl(dentry, ACL_TYPE_ACCESS, pacl); posix_acl_release(dpacl); posix_acl_release(pacl); return 0; -- 1.6.5.2