Re: [PATCH 11/16] f2fs: add inode operations for special inodes

From: Al Viro
Date: Sat Oct 06 2012 - 14:59:20 EST


On Fri, Oct 05, 2012 at 09:03:09PM +0900, ????????? wrote:
> +static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
> + bool excl)
> +{
> + struct super_block *sb = dir->i_sb;
> + struct f2fs_sb_info *sbi = F2FS_SB(sb);
> + struct inode *inode;
> + nid_t ino = 0;
> + int err;
> +
> + if (dentry->d_name.len > F2FS_MAX_NAME_LEN)
> + return -ENAMETOOLONG;

Pointless - failing those on ->lookup() with ENAMETOOLONG is enough.
The same goes for all entry creation methods.

> + if (inode->i_nlink >= F2FS_LINK_MAX)
> + return -EMLINK;

Just set ->s_max_links and be done with that.

> + if (dir->i_nlink >= F2FS_LINK_MAX)
> + return err;

Ditto.

> + if (old_dir_entry) {
> + err = -EMLINK;
> + if (new_dir->i_nlink >= F2FS_LINK_MAX)
> + goto out_dir;

... and here as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/