From patchwork Sat Nov 27 17:37:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 361522 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oARHhKdG007721 for ; Sat, 27 Nov 2010 17:43:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750853Ab0K0RnU (ORCPT ); Sat, 27 Nov 2010 12:43:20 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:55386 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752706Ab0K0RnT (ORCPT ); Sat, 27 Nov 2010 12:43:19 -0500 Received: by gyb11 with SMTP id 11so1381891gyb.19 for ; Sat, 27 Nov 2010 09:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=Krsrhj5Yg4VlZ2AmwrB4fqnfTtqsJVvvT81zaUjAqvk=; b=ScqjJSu0tGvBO+CCUeklpoYpmJ6bwwJQaUx2995s+FYNDdBuYCmk9WEsufNM+1o3RS Z0cvTahTCzkfxVI0e5uT9bcU/A2paADiaXSZHa9WpHw/IAybQuT3tb9ENwrB7Pm8iaQF M5FhfSGA24ZIqYpgMw8w1Kh3MwBTiptg2AIe0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=SUTh7gTa2HlxGJglZ8xjpZ7B9FQ51wPpSI7Hpi/MQrcGAxzHcwgx00a01Ugia48kfb 1y+CSdtkYM6RRvxqCCKdbzNkvbtTo+1MJdSk+3a8yKQRvrR1OhHeYxphp8cuEm0Vmtsb nvii2a2jN6rp098wR23IxEfdPv4/0OEdwAIs8= Received: by 10.100.14.12 with SMTP id 12mr2726846ann.11.1290879798546; Sat, 27 Nov 2010 09:43:18 -0800 (PST) Received: from localhost ([32.97.110.58]) by mx.google.com with ESMTPS id b26sm2900331anb.33.2010.11.27.09.43.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 27 Nov 2010 09:43:18 -0800 (PST) From: shirishpargaonkar@gmail.com To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Shirish Pargaonkar Subject: [PATCH] cifs: Misc. cleanup in cifsacl handling [try #4] Date: Sat, 27 Nov 2010 11:37:26 -0600 Message-Id: <1290879446-12783-1-git-send-email-shirishpargaonkar@gmail.com> X-Mailer: git-send-email 1.6.0.2 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 27 Nov 2010 17:43:21 +0000 (UTC) diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index 91992ab..c15e3ee 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c @@ -726,7 +726,7 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr, } /* Convert mode bits to an ACL so we can update the ACL on the server */ -int mode_to_acl(struct inode *inode, const char *path, __u64 nmode) +int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode) { int rc = 0; __u32 secdesclen = 0; diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 6ed59af..b498731 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h @@ -133,7 +133,7 @@ extern int cifs_get_inode_info_unix(struct inode **pinode, extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr, struct inode *inode, const char *path, const __u16 *pfid); -extern int mode_to_acl(struct inode *inode, const char *path, __u64); +extern int mode_to_cifs_acl(struct inode *inode, const char *path, __u64); extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, const char *); diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ff7d299..122e065 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -689,8 +689,13 @@ int cifs_get_inode_info(struct inode **pinode, #ifdef CONFIG_CIFS_EXPERIMENTAL /* fill in 0777 bits from ACL */ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { - cFYI(1, "Getting mode bits from ACL"); - cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid); + rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, + pfid); + if (rc) { + cFYI(1, "%s: Getting ACL failed with error: %d", + __func__, rc); + goto cgii_exit; + } } #endif @@ -2115,9 +2120,14 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) if (attrs->ia_valid & ATTR_MODE) { rc = 0; #ifdef CONFIG_CIFS_EXPERIMENTAL - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) - rc = mode_to_acl(inode, full_path, mode); - else + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { + rc = mode_to_cifs_acl(inode, full_path, mode); + if (rc) { + cFYI(1, "%s: Setting ACL failed with error: %d", + __func__, rc); + goto cifs_setattr_exit; + } + } else #endif if (((mode & S_IWUGO) == 0) && (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {