These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / fs / nilfs2 / namei.c
index 2218083..c9a1a49 100644 (file)
@@ -120,9 +120,6 @@ nilfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev)
        struct nilfs_transaction_info ti;
        int err;
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        err = nilfs_transaction_begin(dir->i_sb, &ti, 1);
        if (err)
                return err;
@@ -496,8 +493,7 @@ static struct dentry *nilfs_fh_to_dentry(struct super_block *sb, struct fid *fh,
 {
        struct nilfs_fid *fid = (struct nilfs_fid *)fh;
 
-       if ((fh_len != NILFS_FID_SIZE_NON_CONNECTABLE &&
-            fh_len != NILFS_FID_SIZE_CONNECTABLE) ||
+       if (fh_len < NILFS_FID_SIZE_NON_CONNECTABLE ||
            (fh_type != FILEID_NILFS_WITH_PARENT &&
             fh_type != FILEID_NILFS_WITHOUT_PARENT))
                return NULL;
@@ -510,7 +506,7 @@ static struct dentry *nilfs_fh_to_parent(struct super_block *sb, struct fid *fh,
 {
        struct nilfs_fid *fid = (struct nilfs_fid *)fh;
 
-       if (fh_len != NILFS_FID_SIZE_CONNECTABLE ||
+       if (fh_len < NILFS_FID_SIZE_CONNECTABLE ||
            fh_type != FILEID_NILFS_WITH_PARENT)
                return NULL;