diff options
Diffstat (limited to 'fs/affs/namei.c')
-rw-r--r-- | fs/affs/namei.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/affs/namei.c b/fs/affs/namei.c index 960d336ec694..d70bbbac6b7b 100644 --- a/fs/affs/namei.c +++ b/fs/affs/namei.c | |||
@@ -341,10 +341,13 @@ affs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) | |||
341 | p = (char *)AFFS_HEAD(bh)->table; | 341 | p = (char *)AFFS_HEAD(bh)->table; |
342 | lc = '/'; | 342 | lc = '/'; |
343 | if (*symname == '/') { | 343 | if (*symname == '/') { |
344 | struct affs_sb_info *sbi = AFFS_SB(sb); | ||
344 | while (*symname == '/') | 345 | while (*symname == '/') |
345 | symname++; | 346 | symname++; |
346 | while (AFFS_SB(sb)->s_volume[i]) /* Cannot overflow */ | 347 | spin_lock(&sbi->symlink_lock); |
347 | *p++ = AFFS_SB(sb)->s_volume[i++]; | 348 | while (sbi->s_volume[i]) /* Cannot overflow */ |
349 | *p++ = sbi->s_volume[i++]; | ||
350 | spin_unlock(&sbi->symlink_lock); | ||
348 | } | 351 | } |
349 | while (i < maxlen && (c = *symname++)) { | 352 | while (i < maxlen && (c = *symname++)) { |
350 | if (c == '.' && lc == '/' && *symname == '.' && symname[1] == '/') { | 353 | if (c == '.' && lc == '/' && *symname == '.' && symname[1] == '/') { |