mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-26 04:57:57 +00:00
btrfs-progs: Accurate errormsg for resize operation on no-enouth-free-space case
btrfs progs output following error message when doing resize on no-enouth-free-space case: # btrfs filesystem resize +10g /mnt/btrfs_5gb Resize '/mnt/btrfs_5gb' of '+10g' ERROR: unable to resize '/mnt/btrfs_5gb' - File too large # It is not a good description for users, and this patch changed it to: # ./btrfs filesystem resize +10G /mnt/tmp1 Resize '/mnt/tmp1' of '+10G' ERROR: unable to resize '/mnt/tmp1' - no enouth free space # Reported-by: Taeha Kim <kthguru@gmail.com> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ef433bb083
commit
e16cb7cb53
@ -1327,8 +1327,16 @@ static int cmd_filesystem_resize(int argc, char **argv)
|
|||||||
e = errno;
|
e = errno;
|
||||||
close_file_or_dir(fd, dirstream);
|
close_file_or_dir(fd, dirstream);
|
||||||
if( res < 0 ){
|
if( res < 0 ){
|
||||||
fprintf(stderr, "ERROR: unable to resize '%s' - %s\n",
|
switch (e) {
|
||||||
path, strerror(e));
|
case EFBIG:
|
||||||
|
fprintf(stderr, "ERROR: unable to resize '%s' - no enouth free space\n",
|
||||||
|
path);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fprintf(stderr, "ERROR: unable to resize '%s' - %s\n",
|
||||||
|
path, strerror(e));
|
||||||
|
break;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else if (res > 0) {
|
} else if (res > 0) {
|
||||||
const char *err_str = btrfs_err_str(res);
|
const char *err_str = btrfs_err_str(res);
|
||||||
|
Loading…
Reference in New Issue
Block a user