diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/coda/file.c | 2 | ||||
-rw-r--r-- | fs/file_table.c | 7 | ||||
-rw-r--r-- | fs/hppfs/hppfs.c | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/fs/coda/file.c b/fs/coda/file.c index 29137ff3ca67..5a8769985494 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c | |||
@@ -174,7 +174,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file) | |||
174 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); | 174 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); |
175 | 175 | ||
176 | err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), | 176 | err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), |
177 | coda_flags, coda_file->f_uid); | 177 | coda_flags, coda_file->f_cred->fsuid); |
178 | 178 | ||
179 | host_inode = cfi->cfi_container->f_path.dentry->d_inode; | 179 | host_inode = cfi->cfi_container->f_path.dentry->d_inode; |
180 | cii = ITOC(coda_inode); | 180 | cii = ITOC(coda_inode); |
diff --git a/fs/file_table.c b/fs/file_table.c index bc4563fe791d..0fbcacc3ea75 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -36,7 +36,9 @@ static struct percpu_counter nr_files __cacheline_aligned_in_smp; | |||
36 | 36 | ||
37 | static inline void file_free_rcu(struct rcu_head *head) | 37 | static inline void file_free_rcu(struct rcu_head *head) |
38 | { | 38 | { |
39 | struct file *f = container_of(head, struct file, f_u.fu_rcuhead); | 39 | struct file *f = container_of(head, struct file, f_u.fu_rcuhead); |
40 | |||
41 | put_cred(f->f_cred); | ||
40 | kmem_cache_free(filp_cachep, f); | 42 | kmem_cache_free(filp_cachep, f); |
41 | } | 43 | } |
42 | 44 | ||
@@ -121,8 +123,7 @@ struct file *get_empty_filp(void) | |||
121 | INIT_LIST_HEAD(&f->f_u.fu_list); | 123 | INIT_LIST_HEAD(&f->f_u.fu_list); |
122 | atomic_long_set(&f->f_count, 1); | 124 | atomic_long_set(&f->f_count, 1); |
123 | rwlock_init(&f->f_owner.lock); | 125 | rwlock_init(&f->f_owner.lock); |
124 | f->f_uid = cred->fsuid; | 126 | f->f_cred = get_cred(cred); |
125 | f->f_gid = cred->fsgid; | ||
126 | eventpoll_init_file(f); | 127 | eventpoll_init_file(f); |
127 | /* f->f_version: 0 */ | 128 | /* f->f_version: 0 */ |
128 | return f; | 129 | return f; |
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index 795e2c130ad7..b278f7f52024 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c | |||
@@ -426,7 +426,7 @@ static int file_mode(int fmode) | |||
426 | 426 | ||
427 | static int hppfs_open(struct inode *inode, struct file *file) | 427 | static int hppfs_open(struct inode *inode, struct file *file) |
428 | { | 428 | { |
429 | const struct cred *cred = current_cred(); | 429 | const struct cred *cred = file->f_cred; |
430 | struct hppfs_private *data; | 430 | struct hppfs_private *data; |
431 | struct vfsmount *proc_mnt; | 431 | struct vfsmount *proc_mnt; |
432 | struct dentry *proc_dentry; | 432 | struct dentry *proc_dentry; |
@@ -490,7 +490,7 @@ static int hppfs_open(struct inode *inode, struct file *file) | |||
490 | 490 | ||
491 | static int hppfs_dir_open(struct inode *inode, struct file *file) | 491 | static int hppfs_dir_open(struct inode *inode, struct file *file) |
492 | { | 492 | { |
493 | const struct cred *cred = current_cred(); | 493 | const struct cred *cred = file->f_cred; |
494 | struct hppfs_private *data; | 494 | struct hppfs_private *data; |
495 | struct vfsmount *proc_mnt; | 495 | struct vfsmount *proc_mnt; |
496 | struct dentry *proc_dentry; | 496 | struct dentry *proc_dentry; |