Skip to content

Commit

Permalink
sysv: bury the broken "quietly truncate the long filenames" logics
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Al Viro committed Apr 9, 2019
1 parent 357ab5b commit 1d8b29f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
15 changes: 0 additions & 15 deletions fs/sysv/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions fs/sysv/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down
3 changes: 0 additions & 3 deletions fs/sysv/sysv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1d8b29f

Please sign in to comment.