diff mbox

[14/15] cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid

Message ID 1282332731-17444-15-git-send-email-jlayton@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton Aug. 20, 2010, 7:32 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 026d7dd..d52ca4a 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1747,11 +1747,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;
 }