From 49418b2c28c901294f8b36ff14c766c9458c3623 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Wed, 6 Feb 2013 00:57:56 -0800 Subject: cifs: Modify struct cifs_unix_set_info_args to hold a kuid_t and a kgid_t Use INVALID_UID and INVALID_GID instead of NO_CHANGE_64 to indicate the value should not be changed. In cifs_fill_unix_set_info convert from kuids and kgids into uids and gids that will fit in FILE_UNIX_BASIC_INFO. Cc: Steve French Signed-off-by: "Eric W. Biederman" --- fs/cifs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/cifs/file.c') diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 0a6677ba212b..b9baf5f66349 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -487,8 +487,8 @@ int cifs_open(struct inode *inode, struct file *file) */ struct cifs_unix_set_info_args args = { .mode = inode->i_mode, - .uid = NO_CHANGE_64, - .gid = NO_CHANGE_64, + .uid = INVALID_UID, /* no change */ + .gid = INVALID_GID, /* no change */ .ctime = NO_CHANGE_64, .atime = NO_CHANGE_64, .mtime = NO_CHANGE_64, -- cgit v1.2.3-59-g8ed1b From fef59fd728366aa9bf125b8859aff84fa0bd1a36 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Wed, 6 Feb 2013 02:23:02 -0800 Subject: cifs: Convert struct cifsFileInfo to use a kuid Cc: Steve French Signed-off-by: "Eric W. Biederman" --- fs/cifs/cifsglob.h | 2 +- fs/cifs/file.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/cifs/file.c') diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 98312fda0d35..04aa74e5b348 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -930,7 +930,7 @@ struct cifsFileInfo { struct list_head tlist; /* pointer to next fid owned by tcon */ struct list_head flist; /* next fid (file instance) for this inode */ struct cifs_fid_locks *llist; /* brlocks held by this fid */ - unsigned int uid; /* allows finding which FileInfo structure */ + kuid_t uid; /* allows finding which FileInfo structure */ __u32 pid; /* process id who opened file */ struct cifs_fid fid; /* file id from remote */ /* BB add lock scope info here if needed */ ; diff --git a/fs/cifs/file.c b/fs/cifs/file.c index b9baf5f66349..c23fbd81fe1a 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1649,7 +1649,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, are always at the end of the list but since the first entry might have a close pending, we go through the whole list */ list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { - if (fsuid_only && open_file->uid != current_fsuid()) + if (fsuid_only && !uid_eq(open_file->uid, current_fsuid())) continue; if (OPEN_FMODE(open_file->f_flags) & FMODE_READ) { if (!open_file->invalidHandle) { @@ -1702,7 +1702,7 @@ refind_writable: list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { if (!any_available && open_file->pid != current->tgid) continue; - if (fsuid_only && open_file->uid != current_fsuid()) + if (fsuid_only && !uid_eq(open_file->uid, current_fsuid())) continue; if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) { if (!open_file->invalidHandle) { -- cgit v1.2.3-59-g8ed1b