Commit 9d02cebd authored by Al Viro's avatar Al Viro Committed by Luis Henriques

fix sysvfs symlinks

commit 0ebf7f10 upstream.

The thing got broken back in 2002 - sysvfs does *not* have inline
symlinks; even short ones have bodies stored in the first block
of file.  sysv_symlink() handles that correctly; unfortunately,
attempting to look an existing symlink up will end up confusing
them for inline symlinks, and interpret the block number containing
the body as the body itself.

Nobody has noticed until now, which says something about the level
of testing sysvfs gets ;-/
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 57256089
...@@ -162,14 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev) ...@@ -162,14 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev)
inode->i_fop = &sysv_dir_operations; inode->i_fop = &sysv_dir_operations;
inode->i_mapping->a_ops = &sysv_aops; inode->i_mapping->a_ops = &sysv_aops;
} else if (S_ISLNK(inode->i_mode)) { } else if (S_ISLNK(inode->i_mode)) {
if (inode->i_blocks) { inode->i_op = &sysv_symlink_inode_operations;
inode->i_op = &sysv_symlink_inode_operations; inode->i_mapping->a_ops = &sysv_aops;
inode->i_mapping->a_ops = &sysv_aops;
} else {
inode->i_op = &sysv_fast_symlink_inode_operations;
nd_terminate_link(SYSV_I(inode)->i_data, inode->i_size,
sizeof(SYSV_I(inode)->i_data) - 1);
}
} else } else
init_special_inode(inode, inode->i_mode, rdev); init_special_inode(inode, inode->i_mode, rdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment