ext4: add reclaim checks to xattr code
[sfrench/cifs-2.6.git] / fs / ext4 / xattr.c
index 372208500f4e766f0167ce4597f777dafc6891f2..083c95126781db19bf5fb7c72faa5781a185a8ab 100644 (file)
@@ -1462,6 +1462,9 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value,
        if (!ce)
                return NULL;
 
+       WARN_ON_ONCE(ext4_handle_valid(journal_current_handle()) &&
+                    !(current->flags & PF_MEMALLOC_NOFS));
+
        ea_data = kvmalloc(value_len, GFP_KERNEL);
        if (!ea_data) {
                mb_cache_entry_put(ea_inode_cache, ce);
@@ -2327,6 +2330,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
                        error = -ENOSPC;
                        goto cleanup;
                }
+               WARN_ON_ONCE(!(current->flags & PF_MEMALLOC_NOFS));
        }
 
        error = ext4_reserve_inode_write(handle, inode, &is.iloc);