Skip to content

Commit f1bf907

Browse files
Fabian FrederickAl Viro
authored andcommitted
fs/affs: bugfix: make symbolic links work again
AFFS symbolic links were broken since kernel 2.6.29 Problem was bisected to the following commit ebd09ab ("vfs: ensure page symlinks are NUL-terminated") commit 0351468 ("vfs: introduce helper function to safely NUL-terminate symlinks") AFFS wasn't setting inode size when reading symbolic link from disk or creating a new one. Result was zero allocation in pagecache. ln -s file symlink ls -lrt file symlink -> This patch adds inode isize information on inode get and symbolic link addition. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 4f7d029 commit f1bf907

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/affs/inode.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
140140
inode->i_fop = &affs_file_operations;
141141
break;
142142
case ST_SOFTLINK:
143+
inode->i_size = strlen((char *)AFFS_HEAD(bh)->table);
143144
inode->i_mode |= S_IFLNK;
144145
inode_nohighmem(inode);
145146
inode->i_op = &affs_symlink_inode_operations;

‎fs/affs/namei.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ affs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
365365
symname++;
366366
}
367367
*p = 0;
368+
inode->i_size = i + 1;
368369
mark_buffer_dirty_inode(bh, inode);
369370
affs_brelse(bh);
370371
mark_inode_dirty(inode);

0 commit comments

Comments
 (0)