From 338b2f57499f37c18887182b48a499efb8a6b68f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 15 Jun 2013 05:53:23 +0400 Subject: ncpfs: don't bother with EBUSY on removal of busy directories Signed-off-by: Al Viro --- fs/ncpfs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/ncpfs/inode.c') diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 26910c8154d..0765ad12c38 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c @@ -891,6 +891,10 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr) if (!server) /* How this could happen? */ goto out; + result = -EPERM; + if (IS_DEADDIR(dentry->d_inode)) + goto out; + /* ageing the dentry to force validation */ ncp_age_dentry(server, dentry); -- cgit v1.2.3-70-g09d2 From 4fbeb19d53cc3ef2da4bd1fd89a5dc9ac04add3a Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Thu, 4 Jul 2013 21:43:32 +0800 Subject: ncpfs: fix error return code in ncp_parse_options() Fix to return -EINVAL from the option parse error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Signed-off-by: Al Viro --- fs/ncpfs/inode.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'fs/ncpfs/inode.c') diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 0765ad12c38..4659da67e7f 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) switch (optval) { case 'u': data->uid = make_kuid(current_user_ns(), optint); - if (!uid_valid(data->uid)) + if (!uid_valid(data->uid)) { + ret = -EINVAL; goto err; + } break; case 'g': data->gid = make_kgid(current_user_ns(), optint); - if (!gid_valid(data->gid)) + if (!gid_valid(data->gid)) { + ret = -EINVAL; goto err; + } break; case 'o': data->mounted_uid = make_kuid(current_user_ns(), optint); - if (!uid_valid(data->mounted_uid)) + if (!uid_valid(data->mounted_uid)) { + ret = -EINVAL; goto err; + } break; case 'm': data->file_mode = optint; -- cgit v1.2.3-70-g09d2