All callers of terminate_walk() are followed by more or less
open-coded eqiuvalent of "do put_link() on everything left
in nd->stack". Better done in terminate_walk() itself, and
when we go for RCU symlink traversal we'll have to do it
there anyway.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
nd->root.mnt = NULL;
rcu_read_unlock();
}
+ while (unlikely(nd->depth))
+ put_link(nd);
}
/*
}
}
terminate_walk(nd);
- while (unlikely(nd->depth))
- put_link(nd);
return err;
OK:
if (!nd->depth) /* called from path_init(), done */
error = 0;
out:
terminate_walk(nd);
- if (nd->depth)
- put_link(nd);
return error;
}
error = handle_dots(nd, nd->last_type);
if (unlikely(error)) {
terminate_walk(nd);
- if (nd->depth)
- put_link(nd);
return error;
}
goto finish_open;
mnt_drop_write(nd->path.mnt);
path_put(&save_parent);
terminate_walk(nd);
- if (nd->depth)
- put_link(nd);
return error;
exit_dput: