summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-04-02 09:42:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2019-04-09 19:21:06 -0400
commit1d8b29fdb7ef39bd76bcd7a7f516938163097b0e (patch)
tree6529627ac8c398afd4d447e7259c0ecc589df138
parent357ab5b5d240a284b261a62451e838dd9f76e6b9 (diff)
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>
-rw-r--r--fs/sysv/namei.c15
-rw-r--r--fs/sysv/super.c3
-rw-r--r--fs/sysv/sysv.h3
3 files changed, 0 insertions, 21 deletions
diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c
index 4d5d20491ffd..ea2414b385ec 100644
--- a/fs/sysv/namei.c
+++ b/fs/sysv/namei.c
@@ -28,21 +28,6 @@ static int add_nondir(struct dentry *dentry, struct inode *inode)
28 return err; 28 return err;
29} 29}
30 30
31static int sysv_hash(const struct dentry *dentry, struct qstr *qstr)
32{
33 /* Truncate the name in place, avoids having to define a compare
34 function. */
35 if (qstr->len > SYSV_NAMELEN) {
36 qstr->len = SYSV_NAMELEN;
37 qstr->hash = full_name_hash(dentry, qstr->name, qstr->len);
38 }
39 return 0;
40}
41
42const struct dentry_operations sysv_dentry_operations = {
43 .d_hash = sysv_hash,
44};
45
46static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry, unsigned int flags) 31static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry, unsigned int flags)
47{ 32{
48 struct inode * inode = NULL; 33 struct inode * inode = NULL;
diff --git a/fs/sysv/super.c b/fs/sysv/super.c
index 89765ddfb738..d3b2f54d6449 100644
--- a/fs/sysv/super.c
+++ b/fs/sysv/super.c
@@ -312,7 +312,6 @@ static int complete_read_super(struct super_block *sb, int silent, int size)
312 312
313 flavour_setup[sbi->s_type](sbi, &sb->s_max_links); 313 flavour_setup[sbi->s_type](sbi, &sb->s_max_links);
314 314
315 sbi->s_truncate = 1;
316 sbi->s_ndatazones = sbi->s_nzones - sbi->s_firstdatazone; 315 sbi->s_ndatazones = sbi->s_nzones - sbi->s_firstdatazone;
317 sbi->s_inodes_per_block = bsize >> 6; 316 sbi->s_inodes_per_block = bsize >> 6;
318 sbi->s_inodes_per_block_1 = (bsize >> 6)-1; 317 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)
334 sb->s_op = &sysv_sops; 333 sb->s_op = &sysv_sops;
335 if (sbi->s_forced_ro) 334 if (sbi->s_forced_ro)
336 sb->s_flags |= SB_RDONLY; 335 sb->s_flags |= SB_RDONLY;
337 if (sbi->s_truncate)
338 sb->s_d_op = &sysv_dentry_operations;
339 root_inode = sysv_iget(sb, SYSV_ROOT_INO); 336 root_inode = sysv_iget(sb, SYSV_ROOT_INO);
340 if (IS_ERR(root_inode)) { 337 if (IS_ERR(root_inode)) {
341 printk("SysV FS: get root inode failed\n"); 338 printk("SysV FS: get root inode failed\n");
diff --git a/fs/sysv/sysv.h b/fs/sysv/sysv.h
index e913698779c0..1cff585526b1 100644
--- a/fs/sysv/sysv.h
+++ b/fs/sysv/sysv.h
@@ -23,8 +23,6 @@ struct sysv_sb_info {
23 struct super_block *s_sb; /* VFS superblock */ 23 struct super_block *s_sb; /* VFS superblock */
24 int s_type; /* file system type: FSTYPE_{XENIX|SYSV|COH} */ 24 int s_type; /* file system type: FSTYPE_{XENIX|SYSV|COH} */
25 char s_bytesex; /* bytesex (le/be/pdp) */ 25 char s_bytesex; /* bytesex (le/be/pdp) */
26 char s_truncate; /* if 1: names > SYSV_NAMELEN chars are truncated */
27 /* if 0: they are disallowed (ENAMETOOLONG) */
28 unsigned int s_inodes_per_block; /* number of inodes per block */ 26 unsigned int s_inodes_per_block; /* number of inodes per block */
29 unsigned int s_inodes_per_block_1; /* inodes_per_block - 1 */ 27 unsigned int s_inodes_per_block_1; /* inodes_per_block - 1 */
30 unsigned int s_inodes_per_block_bits; /* log2(inodes_per_block) */ 28 unsigned int s_inodes_per_block_bits; /* log2(inodes_per_block) */
@@ -166,7 +164,6 @@ extern const struct file_operations sysv_file_operations;
166extern const struct file_operations sysv_dir_operations; 164extern const struct file_operations sysv_dir_operations;
167extern const struct address_space_operations sysv_aops; 165extern const struct address_space_operations sysv_aops;
168extern const struct super_operations sysv_sops; 166extern const struct super_operations sysv_sops;
169extern const struct dentry_operations sysv_dentry_operations;
170 167
171 168
172enum { 169enum {