mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 14:21:47 +00:00
fs/affs: bugfix: make symbolic links work again
AFFS symbolic links were broken since kernel 2.6.29 Problem was bisected to the following commitebd09abbd9
("vfs: ensure page symlinks are NUL-terminated") commit035146851c
("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>
This commit is contained in:
parent
4f7d029b9b
commit
f1bf90724d
@ -140,6 +140,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
|
||||
inode->i_fop = &affs_file_operations;
|
||||
break;
|
||||
case ST_SOFTLINK:
|
||||
inode->i_size = strlen((char *)AFFS_HEAD(bh)->table);
|
||||
inode->i_mode |= S_IFLNK;
|
||||
inode_nohighmem(inode);
|
||||
inode->i_op = &affs_symlink_inode_operations;
|
||||
|
@ -365,6 +365,7 @@ affs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
|
||||
symname++;
|
||||
}
|
||||
*p = 0;
|
||||
inode->i_size = i + 1;
|
||||
mark_buffer_dirty_inode(bh, inode);
|
||||
affs_brelse(bh);
|
||||
mark_inode_dirty(inode);
|
||||
|
Loading…
Reference in New Issue
Block a user