aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/hypfs
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/hypfs')
-rw-r--r--arch/s390/hypfs/inode.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 6767b437a10..06ea69bd387 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -31,8 +31,8 @@ static struct dentry *hypfs_create_update_file(struct super_block *sb,
31 struct dentry *dir); 31 struct dentry *dir);
32 32
33struct hypfs_sb_info { 33struct hypfs_sb_info {
34 uid_t uid; /* uid used for files and dirs */ 34 kuid_t uid; /* uid used for files and dirs */
35 gid_t gid; /* gid used for files and dirs */ 35 kgid_t gid; /* gid used for files and dirs */
36 struct dentry *update_file; /* file to trigger update */ 36 struct dentry *update_file; /* file to trigger update */
37 time_t last_update; /* last update time in secs since 1970 */ 37 time_t last_update; /* last update time in secs since 1970 */
38 struct mutex lock; /* lock to protect update process */ 38 struct mutex lock; /* lock to protect update process */
@@ -72,8 +72,6 @@ static void hypfs_remove(struct dentry *dentry)
72 struct dentry *parent; 72 struct dentry *parent;
73 73
74 parent = dentry->d_parent; 74 parent = dentry->d_parent;
75 if (!parent || !parent->d_inode)
76 return;
77 mutex_lock(&parent->d_inode->i_mutex); 75 mutex_lock(&parent->d_inode->i_mutex);
78 if (hypfs_positive(dentry)) { 76 if (hypfs_positive(dentry)) {
79 if (S_ISDIR(dentry->d_inode->i_mode)) 77 if (S_ISDIR(dentry->d_inode->i_mode))
@@ -229,6 +227,8 @@ static int hypfs_parse_options(char *options, struct super_block *sb)
229{ 227{
230 char *str; 228 char *str;
231 substring_t args[MAX_OPT_ARGS]; 229 substring_t args[MAX_OPT_ARGS];
230 kuid_t uid;
231 kgid_t gid;
232 232
233 if (!options) 233 if (!options)
234 return 0; 234 return 0;
@@ -243,12 +243,18 @@ static int hypfs_parse_options(char *options, struct super_block *sb)
243 case opt_uid: 243 case opt_uid:
244 if (match_int(&args[0], &option)) 244 if (match_int(&args[0], &option))
245 return -EINVAL; 245 return -EINVAL;
246 hypfs_info->uid = option; 246 uid = make_kuid(current_user_ns(), option);
247 if (!uid_valid(uid))
248 return -EINVAL;
249 hypfs_info->uid = uid;
247 break; 250 break;
248 case opt_gid: 251 case opt_gid:
249 if (match_int(&args[0], &option)) 252 if (match_int(&args[0], &option))
250 return -EINVAL; 253 return -EINVAL;
251 hypfs_info->gid = option; 254 gid = make_kgid(current_user_ns(), option);
255 if (!gid_valid(gid))
256 return -EINVAL;
257 hypfs_info->gid = gid;
252 break; 258 break;
253 case opt_err: 259 case opt_err:
254 default: 260 default:
@@ -263,8 +269,8 @@ static int hypfs_show_options(struct seq_file *s, struct dentry *root)
263{ 269{
264 struct hypfs_sb_info *hypfs_info = root->d_sb->s_fs_info; 270 struct hypfs_sb_info *hypfs_info = root->d_sb->s_fs_info;
265 271
266 seq_printf(s, ",uid=%u", hypfs_info->uid); 272 seq_printf(s, ",uid=%u", from_kuid_munged(&init_user_ns, hypfs_info->uid));
267 seq_printf(s, ",gid=%u", hypfs_info->gid); 273 seq_printf(s, ",gid=%u", from_kgid_munged(&init_user_ns, hypfs_info->gid));
268 return 0; 274 return 0;
269} 275}
270 276