Skip to content

Commit 0ebf7f1

Browse files
author
Al Viro
committed
fix sysvfs symlinks
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 ;-/ Cc: stable@vger.kernel.org # all of them, not that anyone cared Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 1ec2183 commit 0ebf7f1

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

fs/sysv/inode.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev)
162162
inode->i_fop = &sysv_dir_operations;
163163
inode->i_mapping->a_ops = &sysv_aops;
164164
} else if (S_ISLNK(inode->i_mode)) {
165-
if (inode->i_blocks) {
166-
inode->i_op = &sysv_symlink_inode_operations;
167-
inode->i_mapping->a_ops = &sysv_aops;
168-
} else {
169-
inode->i_op = &simple_symlink_inode_operations;
170-
inode->i_link = (char *)SYSV_I(inode)->i_data;
171-
nd_terminate_link(inode->i_link, inode->i_size,
172-
sizeof(SYSV_I(inode)->i_data) - 1);
173-
}
165+
inode->i_op = &sysv_symlink_inode_operations;
166+
inode->i_mapping->a_ops = &sysv_aops;
174167
} else
175168
init_special_inode(inode, inode->i_mode, rdev);
176169
}

0 commit comments

Comments
 (0)