ubifs: Fix inode data budget in ubifs_mknod
authorHyunchul Lee <cheol.lee@lge.com>
Tue, 16 May 2017 23:57:18 +0000 (08:57 +0900)
committerRichard Weinberger <richard@nod.at>
Fri, 14 Jul 2017 20:49:05 +0000 (22:49 +0200)
Assign inode data budget to budget request correctly.

Signed-off-by: Hyunchul Lee <cheol.lee@lge.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/dir.c

index 566079d9b402cdde6082260fca6e07f42f0064e8..4e4bf8f6320fc3d45d75d6b7e7a107c5869bbc66 100644 (file)
@@ -1061,7 +1061,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
        int sz_change;
        int err, devlen = 0;
        struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
-                                       .new_ino_d = ALIGN(devlen, 8),
                                        .dirtied_ino = 1 };
        struct fscrypt_name nm;
 
@@ -1079,6 +1078,7 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
                devlen = ubifs_encode_dev(dev, rdev);
        }
 
+       req.new_ino_d = ALIGN(devlen, 8);
        err = ubifs_budget_space(c, &req);
        if (err) {
                kfree(dev);