Skip to content

Commit 834ba60

Browse files
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: Anton Altaparmakov <aia21@cantab.net>
1 parent 20fdcf1 commit 834ba60

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎fs/ntfs/ChangeLog‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ ToDo/Notes:
1616
inode having been discarded already. Whether this can actually ever
1717
happen is unclear however so it is worth waiting until someone hits
1818
the problem.
19-
- Enable the code for setting the NT4 compatibility flag when we start
20-
making NTFS 1.2 specific modifications.
2119

2220
2.1.27 - Various bug fixes and cleanups.
2321

@@ -43,6 +41,8 @@ ToDo/Notes:
4341
have an index allocation attribute failed.
4442
- Add a missing call to flush_dcache_mft_record_page() in
4543
fs/ntfs/inode.c::ntfs_write_inode().
44+
- Handle the recently introduced -ENAMETOOLONG return value from
45+
fs/ntfs/unistr.c::ntfs_nlstoucs() in fs/ntfs/namei.c::ntfs_lookup().
4646

4747
2.1.26 - Minor bug fixes and updates.
4848

‎fs/ntfs/namei.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
115115
uname_len = ntfs_nlstoucs(vol, dent->d_name.name, dent->d_name.len,
116116
&uname);
117117
if (uname_len < 0) {
118-
ntfs_error(vol->sb, "Failed to convert name to Unicode.");
118+
if (uname_len != -ENAMETOOLONG)
119+
ntfs_error(vol->sb, "Failed to convert name to "
120+
"Unicode.");
119121
return ERR_PTR(uname_len);
120122
}
121123
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,
157159
/* Return the error code. */
158160
return (struct dentry *)dent_inode;
159161
}
160-
/* It is guaranteed that name is no longer allocated at this point. */
162+
/* It is guaranteed that @name is no longer allocated at this point. */
161163
if (MREF_ERR(mref) == -ENOENT) {
162164
ntfs_debug("Entry was not found, adding negative dentry.");
163165
/* The dcache will handle negative entries. */
@@ -168,7 +170,6 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
168170
ntfs_error(vol->sb, "ntfs_lookup_ino_by_name() failed with error "
169171
"code %i.", -MREF_ERR(mref));
170172
return ERR_PTR(MREF_ERR(mref));
171-
172173
// TODO: Consider moving this lot to a separate function! (AIA)
173174
handle_name:
174175
{

0 commit comments

Comments
 (0)