From: Darrick J. Wong Date: Mon, 8 Sep 2014 23:11:55 +0000 (-0700) Subject: misc: don't return ENOMEM if we run out of disk space X-Git-Tag: v1.43-WIP-2015-05-18~206 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=4f769f4c03e7b3a8dd5ca129bbb820f0d00f2423;p=tools%2Fe2fsprogs.git misc: don't return ENOMEM if we run out of disk space 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 Signed-off-by: Theodore Ts'o --- 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;