summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/ext2/balloc.c14
-rw-r--r--fs/ext2/xattr.c3
2 files changed, 9 insertions, 8 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index a9648c3137db..dd74c77a4ac1 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -1244,15 +1244,15 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
es = EXT2_SB(sb)->s_es;
ext2_debug("goal=%lu.\n", goal);
/*
- * Allocate a block from reservation only when
- * filesystem is mounted with reservation(default,-o reservation), and
- * it's a regular file, and
- * the desired window size is greater than 0 (One could use ioctl
- * command EXT2_IOC_SETRSVSZ to set the window size to 0 to turn off
- * reservation on that particular file)
+ * Allocate a block from reservation only when the filesystem is
+ * mounted with reservation(default,-o reservation), and it's a regular
+ * file, and the desired window size is greater than 0 (One could use
+ * ioctl command EXT2_IOC_SETRSVSZ to set the window size to 0 to turn
+ * off reservation on that particular file). Also do not use the
+ * reservation window if the caller asked us not to do it.
*/
block_i = EXT2_I(inode)->i_block_alloc_info;
- if (block_i) {
+ if (!(flags & EXT2_ALLOC_NORESERVE) && block_i) {
windowsz = block_i->rsv_window_node.rsv_goal_size;
if (windowsz > 0)
my_rsv = &block_i->rsv_window_node;
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 3b4ff6974ab8..b7c64fc1c008 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -744,7 +744,8 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
EXT2_I(inode)->i_block_group);
unsigned long count = 1;
ext2_fsblk_t block = ext2_new_blocks(inode, goal,
- &count, &error, 0);
+ &count, &error,
+ EXT2_ALLOC_NORESERVE);
if (error)
goto cleanup;
ea_idebug(inode, "creating block %lu", block);