Commit 834ba600 authored by Anton Altaparmakov's avatar Anton Altaparmakov

NTFS: Handle the recently introduced -ENAMETOOLONG return value from

      fs/ntfs/unistr.c::ntfs_nlstoucs() in fs/ntfs/namei.c::ntfs_lookup().
Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent 20fdcf1d
...@@ -16,8 +16,6 @@ ToDo/Notes: ...@@ -16,8 +16,6 @@ ToDo/Notes:
inode having been discarded already. Whether this can actually ever inode having been discarded already. Whether this can actually ever
happen is unclear however so it is worth waiting until someone hits happen is unclear however so it is worth waiting until someone hits
the problem. the problem.
- Enable the code for setting the NT4 compatibility flag when we start
making NTFS 1.2 specific modifications.
2.1.27 - Various bug fixes and cleanups. 2.1.27 - Various bug fixes and cleanups.
...@@ -43,6 +41,8 @@ ToDo/Notes: ...@@ -43,6 +41,8 @@ ToDo/Notes:
have an index allocation attribute failed. have an index allocation attribute failed.
- Add a missing call to flush_dcache_mft_record_page() in - Add a missing call to flush_dcache_mft_record_page() in
fs/ntfs/inode.c::ntfs_write_inode(). fs/ntfs/inode.c::ntfs_write_inode().
- Handle the recently introduced -ENAMETOOLONG return value from
fs/ntfs/unistr.c::ntfs_nlstoucs() in fs/ntfs/namei.c::ntfs_lookup().
2.1.26 - Minor bug fixes and updates. 2.1.26 - Minor bug fixes and updates.
......
...@@ -115,7 +115,9 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, ...@@ -115,7 +115,9 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
uname_len = ntfs_nlstoucs(vol, dent->d_name.name, dent->d_name.len, uname_len = ntfs_nlstoucs(vol, dent->d_name.name, dent->d_name.len,
&uname); &uname);
if (uname_len < 0) { if (uname_len < 0) {
ntfs_error(vol->sb, "Failed to convert name to Unicode."); if (uname_len != -ENAMETOOLONG)
ntfs_error(vol->sb, "Failed to convert name to "
"Unicode.");
return ERR_PTR(uname_len); return ERR_PTR(uname_len);
} }
mref = ntfs_lookup_inode_by_name(NTFS_I(dir_ino), uname, uname_len, mref = ntfs_lookup_inode_by_name(NTFS_I(dir_ino), uname, uname_len,
...@@ -157,7 +159,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, ...@@ -157,7 +159,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
/* Return the error code. */ /* Return the error code. */
return (struct dentry *)dent_inode; return (struct dentry *)dent_inode;
} }
/* It is guaranteed that name is no longer allocated at this point. */ /* It is guaranteed that @name is no longer allocated at this point. */
if (MREF_ERR(mref) == -ENOENT) { if (MREF_ERR(mref) == -ENOENT) {
ntfs_debug("Entry was not found, adding negative dentry."); ntfs_debug("Entry was not found, adding negative dentry.");
/* The dcache will handle negative entries. */ /* The dcache will handle negative entries. */
...@@ -168,7 +170,6 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, ...@@ -168,7 +170,6 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
ntfs_error(vol->sb, "ntfs_lookup_ino_by_name() failed with error " ntfs_error(vol->sb, "ntfs_lookup_ino_by_name() failed with error "
"code %i.", -MREF_ERR(mref)); "code %i.", -MREF_ERR(mref));
return ERR_PTR(MREF_ERR(mref)); return ERR_PTR(MREF_ERR(mref));
// TODO: Consider moving this lot to a separate function! (AIA) // TODO: Consider moving this lot to a separate function! (AIA)
handle_name: handle_name:
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment