Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux
[firefly-linux-kernel-4.4.55.git] / fs / f2fs / xattr.c
index 7d52e8dc0c5962bd2c30007d73f907c8c92255c7..8038c049650473bd260d50006ca75175ec90fa62 100644 (file)
@@ -208,7 +208,7 @@ int f2fs_getxattr(struct inode *inode, int name_index, const char *name,
        struct page *page;
        void *base_addr;
        int error = 0, found = 0;
-       int value_len, name_len;
+       size_t value_len, name_len;
 
        if (name == NULL)
                return -EINVAL;
@@ -304,7 +304,8 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name,
        struct f2fs_xattr_entry *here, *last;
        struct page *page;
        void *base_addr;
-       int error, found, free, name_len, newsize;
+       int error, found, free, newsize;
+       size_t name_len;
        char *pval;
 
        if (name == NULL)
@@ -317,6 +318,8 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name,
        if (name_len > 255 || value_len > MAX_VALUE_LEN)
                return -ERANGE;
 
+       f2fs_balance_fs(sbi);
+
        mutex_lock_op(sbi, NODE_NEW);
        if (!fi->i_xattr_nid) {
                /* Allocate new attribute block */