diff mbox

[03/25] misc: don't return ENOMEM if we run out of disk space

Message ID 20140908231155.25904.55767.stgit@birch.djwong.org
State Accepted, archived
Headers show

Commit Message

Darrick Wong Sept. 8, 2014, 11:11 p.m. UTC
If there aren't enough blocks in the FS to allocate all of the
hugefiles, return ENOSPC, not ENOMEM.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 misc/mk_hugefiles.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Theodore Ts'o Sept. 11, 2014, 4:43 p.m. UTC | #1
On Mon, Sep 08, 2014 at 04:11:55PM -0700, Darrick J. Wong wrote:
> If there aren't enough blocks in the FS to allocate all of the
> hugefiles, return ENOSPC, not ENOMEM.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c
index 8291f01..3e4274c 100644
--- a/misc/mk_hugefiles.c
+++ b/misc/mk_hugefiles.c
@@ -530,10 +530,10 @@  errcode_t mk_hugefiles(ext2_filsys fs, const char *device_name)
 
 	fs_blocks = ext2fs_free_blocks_count(fs->super);
 	if (fs_blocks < num_slack + align)
-		return ENOMEM;
+		return ENOSPC;
 	fs_blocks -= num_slack + align;
 	if (num_blocks && num_blocks > fs_blocks)
-		return ENOMEM;
+		return ENOSPC;
 	if (num_blocks == 0 && num_files == 0)
 		num_files = 1;