1
0
Fork 0

sysv: bury the broken "quietly truncate the long filenames" logics

It's contrary to the normal semantics, only sysv and adfs try to
do that (on any other filesystem you'll get -ENAMETOOLONG instead
of quiet truncation) and nobody actually uses that - it got
accidentally broken 5 years ago and nobody noticed.  Time to
bury it...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
hifive-unleashed-5.2
Al Viro 2019-04-02 09:42:50 -04:00
parent 357ab5b5d2
commit 1d8b29fdb7
3 changed files with 0 additions and 21 deletions

View File

@ -28,21 +28,6 @@ static int add_nondir(struct dentry *dentry, struct inode *inode)
return err;
}
static int sysv_hash(const struct dentry *dentry, struct qstr *qstr)
{
/* Truncate the name in place, avoids having to define a compare
function. */
if (qstr->len > SYSV_NAMELEN) {
qstr->len = SYSV_NAMELEN;
qstr->hash = full_name_hash(dentry, qstr->name, qstr->len);
}
return 0;
}
const struct dentry_operations sysv_dentry_operations = {
.d_hash = sysv_hash,
};
static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry, unsigned int flags)
{
struct inode * inode = NULL;

View File

@ -312,7 +312,6 @@ static int complete_read_super(struct super_block *sb, int silent, int size)
flavour_setup[sbi->s_type](sbi, &sb->s_max_links);
sbi->s_truncate = 1;
sbi->s_ndatazones = sbi->s_nzones - sbi->s_firstdatazone;
sbi->s_inodes_per_block = bsize >> 6;
sbi->s_inodes_per_block_1 = (bsize >> 6)-1;
@ -334,8 +333,6 @@ static int complete_read_super(struct super_block *sb, int silent, int size)
sb->s_op = &sysv_sops;
if (sbi->s_forced_ro)
sb->s_flags |= SB_RDONLY;
if (sbi->s_truncate)
sb->s_d_op = &sysv_dentry_operations;
root_inode = sysv_iget(sb, SYSV_ROOT_INO);
if (IS_ERR(root_inode)) {
printk("SysV FS: get root inode failed\n");

View File

@ -23,8 +23,6 @@ struct sysv_sb_info {
struct super_block *s_sb; /* VFS superblock */
int s_type; /* file system type: FSTYPE_{XENIX|SYSV|COH} */
char s_bytesex; /* bytesex (le/be/pdp) */
char s_truncate; /* if 1: names > SYSV_NAMELEN chars are truncated */
/* if 0: they are disallowed (ENAMETOOLONG) */
unsigned int s_inodes_per_block; /* number of inodes per block */
unsigned int s_inodes_per_block_1; /* inodes_per_block - 1 */
unsigned int s_inodes_per_block_bits; /* log2(inodes_per_block) */
@ -166,7 +164,6 @@ extern const struct file_operations sysv_file_operations;
extern const struct file_operations sysv_dir_operations;
extern const struct address_space_operations sysv_aops;
extern const struct super_operations sysv_sops;
extern const struct dentry_operations sysv_dentry_operations;
enum {