diff options
author | David Howells <dhowells@redhat.com> | 2012-06-25 07:55:18 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:37:27 -0400 |
commit | be34d1a3bc4b6f357a49acb55ae870c81337e4f0 (patch) | |
tree | 39caaf1b4965d47be64ce45491477fce555b2d17 /fs/pnode.c | |
parent | 55e4def0a6e79e7eb53017c4935adfed76510cd7 (diff) |
VFS: Make clone_mnt()/copy_tree()/collect_mounts() return errors
copy_tree() can theoretically fail in a case other than ENOMEM, but always
returns NULL which is interpreted by callers as -ENOMEM. Change it to return
an explicit error.
Also change clone_mnt() for consistency and because union mounts will add new
error cases.
Thanks to Andreas Gruenbacher <agruen@suse.de> for a bug fix.
[AV: folded braino fix by Dan Carpenter]
Original-author: Valerie Aurora <vaurora@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Valerie Aurora <valerie.aurora@gmail.com>
Cc: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pnode.c')
-rw-r--r-- | fs/pnode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/pnode.c b/fs/pnode.c index bed378db0758..3e000a51ac0d 100644 --- a/fs/pnode.c +++ b/fs/pnode.c | |||
@@ -237,8 +237,9 @@ int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry, | |||
237 | 237 | ||
238 | source = get_source(m, prev_dest_mnt, prev_src_mnt, &type); | 238 | source = get_source(m, prev_dest_mnt, prev_src_mnt, &type); |
239 | 239 | ||
240 | if (!(child = copy_tree(source, source->mnt.mnt_root, type))) { | 240 | child = copy_tree(source, source->mnt.mnt_root, type); |
241 | ret = -ENOMEM; | 241 | if (IS_ERR(child)) { |
242 | ret = PTR_ERR(child); | ||
242 | list_splice(tree_list, tmp_list.prev); | 243 | list_splice(tree_list, tmp_list.prev); |
243 | goto out; | 244 | goto out; |
244 | } | 245 | } |