aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-11-25 08:00:40 -0500
committerSteve French <smfrench@gmail.com>2012-12-05 14:27:30 -0500
commitccb5c001b3035ca470fe21424e439530ba838510 (patch)
treeb9d6b233c03b7129334381b6e634533ab9eee10c /fs/cifs/readdir.c
parent3c15b4cf5580658951115f85efb2dea6a1380999 (diff)
cifs: ensure we revalidate the inode after readdir if cifsacl is enabled
Otherwise, "ls -l" will simply show the ownership of the files as the default mnt_uid/gid. This may make "ls -l" performance on large directories super-suck in some cases, but that's the cost of cifsacl. One possibility to make it suck less would be to somehow proactively dispatch the ACL requests asynchronously from readdir codepath, but that's non-trivial to implement. Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r--fs/cifs/readdir.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 1c576e871366..64920920d908 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -137,6 +137,16 @@ cifs_fill_common_info(struct cifs_fattr *fattr, struct cifs_sb_info *cifs_sb)
137 if (fattr->cf_cifsattrs & ATTR_READONLY) 137 if (fattr->cf_cifsattrs & ATTR_READONLY)
138 fattr->cf_mode &= ~S_IWUGO; 138 fattr->cf_mode &= ~S_IWUGO;
139 139
140 /*
141 * We of course don't get ACL info in FIND_FIRST/NEXT results, so
142 * mark it for revalidation so that "ls -l" will look right. It might
143 * be super-slow, but if we don't do this then the ownership of files
144 * may look wrong since the inodes may not have timed out by the time
145 * "ls" does a stat() call on them.
146 */
147 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
148 fattr->cf_flags |= CIFS_FATTR_NEED_REVAL;
149
140 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL && 150 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL &&
141 fattr->cf_cifsattrs & ATTR_SYSTEM) { 151 fattr->cf_cifsattrs & ATTR_SYSTEM) {
142 if (fattr->cf_eof == 0) { 152 if (fattr->cf_eof == 0) {