sysv: bury the broken "quietly truncate the long filenames" logics
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 2 Apr 2019 13:42:50 +0000 (09:42 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 9 Apr 2019 23:21:06 +0000 (19:21 -0400)
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>
fs/sysv/namei.c
fs/sysv/super.c
fs/sysv/sysv.h

index 4d5d20491ffd89a0c034a537d87d57b428a416cc..ea2414b385ecf8c8bdb7bf8312c0cfb5b33c9b71 100644 (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;
index 89765ddfb738c075b44003e0e1dfeea414d24c7f..d3b2f54d6449cfb4fcd39bbfea31d262449ac2f2 100644 (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");
index e913698779c0b517b8449795266e14884f718888..1cff585526b1332520e1c374e64858d1af18cae7 100644 (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 {