From 5018ce791ba48b0f74bebf8a1b91a197a84ca02c Mon Sep 17 00:00:00 2001 From: Dmitry Monakhov Date: Wed, 19 Oct 2011 14:16:23 +0400 Subject: [PATCH] --- yaml --- r: 273087 b: refs/heads/master c: 6360e21f943172bb71772ec150b96a9e787a535f h: refs/heads/master i: 273085: edfd7b5cdb866ccb4b84be7b32d849a6b70569e8 273083: 80739dc54fcca997961eb542f6db1f4a2546242b 273079: 88162a912e3ffe2fc92417497a9f50f76753b165 273071: f3d1e035291fc4026e48a2f75bd4fe6165353b42 273055: 0887b3ade61813d0822f5f1a096c5ceeb6b4c9f4 273023: 914494267f23088cad300eeaf6d60f9dccbe97df v: v3 --- [refs] | 2 +- trunk/fs/ext3/balloc.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 1d8fafde3d27..43ecc41b5569 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 23cc94eaea4436d37c0b7f1f264a319e8f11088f +refs/heads/master: 6360e21f943172bb71772ec150b96a9e787a535f diff --git a/trunk/fs/ext3/balloc.c b/trunk/fs/ext3/balloc.c index a7fceaba87f1..a2038928f9a3 100644 --- a/trunk/fs/ext3/balloc.c +++ b/trunk/fs/ext3/balloc.c @@ -1440,14 +1440,14 @@ ext3_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle, * * Check if filesystem has at least 1 free block available for allocation. */ -static int ext3_has_free_blocks(struct ext3_sb_info *sbi) +static int ext3_has_free_blocks(struct ext3_sb_info *sbi, int use_reservation) { ext3_fsblk_t free_blocks, root_blocks; free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter); root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count); if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) && - sbi->s_resuid != current_fsuid() && + !use_reservation && sbi->s_resuid != current_fsuid() && (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) { return 0; } @@ -1468,7 +1468,7 @@ static int ext3_has_free_blocks(struct ext3_sb_info *sbi) */ int ext3_should_retry_alloc(struct super_block *sb, int *retries) { - if (!ext3_has_free_blocks(EXT3_SB(sb)) || (*retries)++ > 3) + if (!ext3_has_free_blocks(EXT3_SB(sb), 0) || (*retries)++ > 3) return 0; jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); @@ -1546,7 +1546,7 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode, if (block_i && ((windowsz = block_i->rsv_window_node.rsv_goal_size) > 0)) my_rsv = &block_i->rsv_window_node; - if (!ext3_has_free_blocks(sbi)) { + if (!ext3_has_free_blocks(sbi, IS_NOQUOTA(inode))) { *errp = -ENOSPC; goto out; }