-
Tomasz Grabiec authored
The call to namei("/dir/file/") currently fails with ENOENT when "/dir/file" exists. A more standard way is to return ENOTDIR instead. This way calls to stat, open, rename, etc. will be in line with the POSIX spec. It is also useful to rename() implementation which needs to differentiate behaviour between the case in which target does not exist and the case in which it does but the path has trailing slash and the last component is not a directory. In addition to that the check was performed in an inconsistent matter - only when dentry lookup failed. This change makes the check performed always. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Tomasz Grabiec authoredThe call to namei("/dir/file/") currently fails with ENOENT when "/dir/file" exists. A more standard way is to return ENOTDIR instead. This way calls to stat, open, rename, etc. will be in line with the POSIX spec. It is also useful to rename() implementation which needs to differentiate behaviour between the case in which target does not exist and the case in which it does but the path has trailing slash and the last component is not a directory. In addition to that the check was performed in an inconsistent matter - only when dentry lookup failed. This change makes the check performed always. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>