aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2006-03-23 11:25:23 -0500
committerAnton Altaparmakov <aia21@cantab.net>2006-03-23 11:25:23 -0500
commit834ba600cefe6847acaebe5e8e984476dfeebf55 (patch)
tree55b67a2883e7ad67288ba7a2ad94ff195e7b6ed5
parent20fdcf1d543b1285ef8b1c1993a9221f2eda52dc (diff)
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>
-rw-r--r--fs/ntfs/ChangeLog4
-rw-r--r--fs/ntfs/namei.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index d20031587bbb..9fb08ef3a7f8 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -16,8 +16,6 @@ ToDo/Notes:
16 inode having been discarded already. Whether this can actually ever 16 inode having been discarded already. Whether this can actually ever
17 happen is unclear however so it is worth waiting until someone hits 17 happen is unclear however so it is worth waiting until someone hits
18 the problem. 18 the problem.
19 - Enable the code for setting the NT4 compatibility flag when we start
20 making NTFS 1.2 specific modifications.
21 19
222.1.27 - Various bug fixes and cleanups. 202.1.27 - Various bug fixes and cleanups.
23 21
@@ -43,6 +41,8 @@ ToDo/Notes:
43 have an index allocation attribute failed. 41 have an index allocation attribute failed.
44 - Add a missing call to flush_dcache_mft_record_page() in 42 - Add a missing call to flush_dcache_mft_record_page() in
45 fs/ntfs/inode.c::ntfs_write_inode(). 43 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().
46 46
472.1.26 - Minor bug fixes and updates. 472.1.26 - Minor bug fixes and updates.
48 48
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index 78e0cf738e24..eddb2247cec5 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -115,7 +115,9 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
115 uname_len = ntfs_nlstoucs(vol, dent->d_name.name, dent->d_name.len, 115 uname_len = ntfs_nlstoucs(vol, dent->d_name.name, dent->d_name.len,
116 &uname); 116 &uname);
117 if (uname_len < 0) { 117 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.");
119 return ERR_PTR(uname_len); 121 return ERR_PTR(uname_len);
120 } 122 }
121 mref = ntfs_lookup_inode_by_name(NTFS_I(dir_ino), uname, uname_len, 123 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 /* Return the error code. */ 159 /* Return the error code. */
158 return (struct dentry *)dent_inode; 160 return (struct dentry *)dent_inode;
159 } 161 }
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. */
161 if (MREF_ERR(mref) == -ENOENT) { 163 if (MREF_ERR(mref) == -ENOENT) {
162 ntfs_debug("Entry was not found, adding negative dentry."); 164 ntfs_debug("Entry was not found, adding negative dentry.");
163 /* The dcache will handle negative entries. */ 165 /* The dcache will handle negative entries. */
@@ -168,7 +170,6 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
168 ntfs_error(vol->sb, "ntfs_lookup_ino_by_name() failed with error " 170 ntfs_error(vol->sb, "ntfs_lookup_ino_by_name() failed with error "
169 "code %i.", -MREF_ERR(mref)); 171 "code %i.", -MREF_ERR(mref));
170 return ERR_PTR(MREF_ERR(mref)); 172 return ERR_PTR(MREF_ERR(mref));
171
172 // TODO: Consider moving this lot to a separate function! (AIA) 173 // TODO: Consider moving this lot to a separate function! (AIA)
173handle_name: 174handle_name:
174 { 175 {