diff options
author | Sage Weil <sage@inktank.com> | 2013-08-15 14:11:45 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-15 14:11:45 -0400 |
commit | ee3e542fec6e69bc9fb668698889a37d93950ddf (patch) | |
tree | e74ee766a4764769ef1d3d45d266b4dea64101d3 /fs/ncpfs/inode.c | |
parent | fe2a801b50c0bb8039d627e5ae1fec249d10ff39 (diff) | |
parent | f1d6e17f540af37bb1891480143669ba7636c4cf (diff) |
Merge remote-tracking branch 'linus/master' into testing
Diffstat (limited to 'fs/ncpfs/inode.c')
-rw-r--r-- | fs/ncpfs/inode.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 26910c8154da..4659da67e7f6 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c | |||
@@ -403,18 +403,24 @@ static int ncp_parse_options(struct ncp_mount_data_kernel *data, char *options) | |||
403 | switch (optval) { | 403 | switch (optval) { |
404 | case 'u': | 404 | case 'u': |
405 | data->uid = make_kuid(current_user_ns(), optint); | 405 | data->uid = make_kuid(current_user_ns(), optint); |
406 | if (!uid_valid(data->uid)) | 406 | if (!uid_valid(data->uid)) { |
407 | ret = -EINVAL; | ||
407 | goto err; | 408 | goto err; |
409 | } | ||
408 | break; | 410 | break; |
409 | case 'g': | 411 | case 'g': |
410 | data->gid = make_kgid(current_user_ns(), optint); | 412 | data->gid = make_kgid(current_user_ns(), optint); |
411 | if (!gid_valid(data->gid)) | 413 | if (!gid_valid(data->gid)) { |
414 | ret = -EINVAL; | ||
412 | goto err; | 415 | goto err; |
416 | } | ||
413 | break; | 417 | break; |
414 | case 'o': | 418 | case 'o': |
415 | data->mounted_uid = make_kuid(current_user_ns(), optint); | 419 | data->mounted_uid = make_kuid(current_user_ns(), optint); |
416 | if (!uid_valid(data->mounted_uid)) | 420 | if (!uid_valid(data->mounted_uid)) { |
421 | ret = -EINVAL; | ||
417 | goto err; | 422 | goto err; |
423 | } | ||
418 | break; | 424 | break; |
419 | case 'm': | 425 | case 'm': |
420 | data->file_mode = optint; | 426 | data->file_mode = optint; |
@@ -891,6 +897,10 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr) | |||
891 | if (!server) /* How this could happen? */ | 897 | if (!server) /* How this could happen? */ |
892 | goto out; | 898 | goto out; |
893 | 899 | ||
900 | result = -EPERM; | ||
901 | if (IS_DEADDIR(dentry->d_inode)) | ||
902 | goto out; | ||
903 | |||
894 | /* ageing the dentry to force validation */ | 904 | /* ageing the dentry to force validation */ |
895 | ncp_age_dentry(server, dentry); | 905 | ncp_age_dentry(server, dentry); |
896 | 906 | ||