diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-05-12 21:19:16 +0200 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-05-12 21:19:16 +0200 |
commit | 2ec2b7e9d5b6b4f3611f639ee5d221e03de18c61 (patch) | |
tree | fc4f373cb27339c457a2f1332031ae4f2674d94e /super0.c | |
parent | Grow: Handle failure to load superblock in Grow_addbitmap() (diff) | |
download | mdadm-2ec2b7e9d5b6b4f3611f639ee5d221e03de18c61.tar.xz mdadm-2ec2b7e9d5b6b4f3611f639ee5d221e03de18c61.zip |
mdadm: Make add_internal_bitmap() return 0 on success
add_internal_bitmap() returned 1 on success and 0 on error which is
inconsistent. This changes it to return 0 on success and use more
reasonable error codes on error.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Diffstat (limited to 'super0.c')
-rw-r--r-- | super0.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1139,7 +1139,7 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp, if (chunk < 64*1024*1024) chunk = 64*1024*1024; } else if ((unsigned long long)chunk < min_chunk) - return 0; /* chunk size too small */ + return -EINVAL; /* chunk size too small */ sb->state |= (1<<MD_SB_BITMAP_PRESENT); @@ -1153,7 +1153,7 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp, bms->sync_size = __cpu_to_le64(size); bms->write_behind = __cpu_to_le32(write_behind); *chunkp = chunk; - return 1; + return 0; } static int locate_bitmap0(struct supertype *st, int fd, int node_num) |