From patchwork Mon Sep 20 23:01:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 196132 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 o8KN290S018281 for ; Mon, 20 Sep 2010 23:02:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757817Ab0ITXCG (ORCPT ); Mon, 20 Sep 2010 19:02:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5819 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757733Ab0ITXCE (ORCPT ); Mon, 20 Sep 2010 19:02:04 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8KN23gn022380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 20 Sep 2010 19:02:03 -0400 Received: from corrin.poochiereds.net (ovpn-113-92.phx2.redhat.com [10.3.113.92]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8KN1bBX001599; Mon, 20 Sep 2010 19:02:01 -0400 From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 13/15] cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid Date: Mon, 20 Sep 2010 16:01:42 -0700 Message-Id: <1285023704-2159-14-git-send-email-jlayton@redhat.com> In-Reply-To: <1285023704-2159-1-git-send-email-jlayton@redhat.com> References: <1285023704-2159-1-git-send-email-jlayton@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 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]); Mon, 20 Sep 2010 23:02:09 +0000 (UTC) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index dcd0886..2256124 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1761,11 +1761,19 @@ check_inval: int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { + struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb); + struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); int err = cifs_revalidate_dentry(dentry); + if (!err) { generic_fillattr(dentry->d_inode, stat); stat->blksize = CIFS_MAX_MSGSIZE; stat->ino = CIFS_I(dentry->d_inode)->uniqueid; + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER && + !tcon->unix_ext) { + stat->uid = current_fsuid(); + stat->gid = current_fsgid(); + } } return err; }