Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit 1935caa

Browse files
Merge branch 'Seagate:main' into test
Signed-off-by: Pratik Patil <[email protected]>
2 parents c1a83ad + 553163b commit 1935caa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+624
-816
lines changed

.alexignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CODE_OF_CONDUCT.md

Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,6 @@ sbin_SCRIPTS += utils/m0gendisks \
788788
utils/m0reportbug \
789789
utils/m0run \
790790
utils/m0setup \
791-
utils/m0iscorrupt \
792791
utils/m0singlenode
793792

794793

@@ -1036,7 +1035,6 @@ motr_commondir = $(motrdir)/common
10361035
motr_common_SCRIPTS = \
10371036
scripts/install$(motr_commondir)/cortx_error_codes.sh \
10381037
scripts/install$(motr_commondir)/cortx_util_funcs.sh \
1039-
scripts/install$(motr_commondir)/core-traces \
10401038
scripts/install$(motr_commondir)/m0_sns_utils_common.sh \
10411039
scripts/install$(motr_commondir)/m0_dix_utils_common.sh \
10421040
scripts/install$(motr_commondir)/m0_utils_common.sh \

balloc/balloc.c

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,7 @@ static int balloc_alloc_db_update(struct m0_balloc *motr, struct m0_be_tx *tx,
17111711
key = (struct m0_buf)M0_BUF_INIT_PTR(&cur->e_end);
17121712

17131713
rc = btree_delete_sync(db, tx, &key);
1714+
M0_ASSERT(rc == 0);
17141715
if (rc != 0)
17151716
return M0_RC(rc);
17161717

@@ -1721,6 +1722,7 @@ static int balloc_alloc_db_update(struct m0_balloc *motr, struct m0_be_tx *tx,
17211722
/* +------+-------+--------------------+ */
17221723
cur->e_end = tgt->e_start;
17231724
rc = balloc_ext_insert(db, tx, *cur);
1725+
M0_ASSERT(rc == 0);
17241726
if (rc != 0)
17251727
return M0_RC(rc);
17261728
maxchunk = max_check(maxchunk, m0_ext_length(cur));
@@ -1742,6 +1744,7 @@ static int balloc_alloc_db_update(struct m0_balloc *motr, struct m0_be_tx *tx,
17421744
/* +------------+----------------------+ */
17431745
cur->e_start = tgt->e_end;
17441746
rc = balloc_ext_update(db, tx, *cur);
1747+
M0_ASSERT(rc == 0);
17451748
if (rc != 0)
17461749
return M0_RC(rc);
17471750

@@ -1754,9 +1757,11 @@ static int balloc_alloc_db_update(struct m0_balloc *motr, struct m0_be_tx *tx,
17541757
/* +-------+---------+-----------------+ */
17551758
new.e_end = tgt->e_start;
17561759
le = lext_create(&new);
1760+
M0_ASSERT(le != NULL);
17571761
if (le == NULL)
17581762
return M0_RC(-ENOMEM);
17591763
rc = balloc_ext_insert(db, tx, new);
1764+
M0_ASSERT(rc == 0);
17601765
if (rc != 0) {
17611766
m0_free(le);
17621767
return M0_RC(rc);
@@ -1854,9 +1859,11 @@ static int balloc_free_db_update(struct m0_balloc *motr,
18541859
/* | | tgt free | | */
18551860
/* +-------+------------------+--------+ */
18561861
le = lext_create(tgt);
1862+
M0_ASSERT(le != NULL);
18571863
if (le == NULL)
18581864
return M0_RC(-ENOMEM);
18591865
rc = balloc_ext_insert(db, tx, *tgt);
1866+
M0_ASSERT(rc == 0);
18601867
if (rc != 0) {
18611868
m0_free(le);
18621869
return M0_RC(rc);
@@ -1873,9 +1880,11 @@ static int balloc_free_db_update(struct m0_balloc *motr,
18731880
/* | | | tgt free | */
18741881
/* +-----------+--+--------------------+ */
18751882
le = lext_create(tgt);
1883+
M0_ASSERT(le != NULL);
18761884
if (le == NULL)
18771885
return M0_RC(-ENOMEM);
18781886
rc = balloc_ext_insert(db, tx, *tgt);
1887+
M0_ASSERT(rc == 0);
18791888
if (rc != 0) {
18801889
m0_free(le);
18811890
return M0_RC(rc);
@@ -1891,10 +1900,12 @@ static int balloc_free_db_update(struct m0_balloc *motr,
18911900
M0_ASSERT(cur->e_end == tgt->e_start);
18921901
key = (struct m0_buf)M0_BUF_INIT_PTR(&cur->e_end);
18931902
rc = btree_delete_sync(db, tx, &key);
1903+
M0_ASSERT(rc == 0);
18941904
if (rc != 0)
18951905
return M0_RC(rc);
18961906
cur->e_end = tgt->e_end;
18971907
rc = balloc_ext_insert(db, tx, *cur);
1908+
M0_ASSERT(rc == 0);
18981909
if (rc != 0)
18991910
return M0_RC(rc);
19001911
maxchunk = max_check(maxchunk, m0_ext_length(cur));
@@ -1909,9 +1920,11 @@ static int balloc_free_db_update(struct m0_balloc *motr,
19091920
/* | | tgt | | | */
19101921
/* +-+---------+---+-------------------+ */
19111922
le = lext_create(tgt);
1923+
M0_ASSERT(le != NULL);
19121924
if (le == NULL)
19131925
return M0_RC(-ENOMEM);
19141926
rc = balloc_ext_insert(db, tx, *tgt);
1927+
M0_ASSERT(rc == 0);
19151928
if (rc != 0) {
19161929
m0_free(le);
19171930
return M0_RC(rc);
@@ -1928,6 +1941,7 @@ static int balloc_free_db_update(struct m0_balloc *motr,
19281941
M0_ASSERT(tgt->e_end == cur->e_start);
19291942
cur->e_start = tgt->e_start;
19301943
rc = balloc_ext_update(db, tx, *cur);
1944+
M0_ASSERT(rc == 0);
19311945
if (rc != 0)
19321946
return M0_RC(rc);
19331947
maxchunk = max_check(maxchunk, m0_ext_length(cur));
@@ -1943,10 +1957,12 @@ static int balloc_free_db_update(struct m0_balloc *motr,
19431957
/* +-------+-------+-------------------+ */
19441958
key = (struct m0_buf)M0_BUF_INIT_PTR(&pre->e_end);
19451959
rc = btree_delete_sync(db, tx, &key);
1960+
M0_ASSERT(rc == 0);
19461961
if (rc != 0)
19471962
return M0_RC(rc);
19481963
cur->e_start = pre->e_start;
19491964
rc = balloc_ext_update(db, tx, *cur);
1965+
M0_ASSERT(rc == 0);
19501966
if (rc != 0)
19511967
return M0_RC(rc);
19521968
le = container_of(pre, struct m0_lext, le_ext);
@@ -1961,10 +1977,12 @@ static int balloc_free_db_update(struct m0_balloc *motr,
19611977
/* +-------+-------+-------------------+ */
19621978
key = (struct m0_buf)M0_BUF_INIT_PTR(&pre->e_end);
19631979
rc = btree_delete_sync(db, tx, &key);
1980+
M0_ASSERT(rc == 0);
19641981
if (rc != 0)
19651982
return M0_RC(rc);
19661983
pre->e_end = tgt->e_end;
19671984
rc = balloc_ext_insert(db, tx, *pre);
1985+
M0_ASSERT(rc == 0);
19681986
if (rc != 0)
19691987
return M0_RC(rc);
19701988
maxchunk = max_check(maxchunk, m0_ext_length(pre));
@@ -1976,6 +1994,7 @@ static int balloc_free_db_update(struct m0_balloc *motr,
19761994
/* +----------+-------+----------------+ */
19771995
cur->e_start = tgt->e_start;
19781996
rc = balloc_ext_update(db, tx, *cur);
1997+
M0_ASSERT(rc == 0);
19791998
if (rc != 0)
19801999
return M0_RC(rc);
19812000
maxchunk = max_check(maxchunk, m0_ext_length(cur));
@@ -1986,9 +2005,11 @@ static int balloc_free_db_update(struct m0_balloc *motr,
19862005
/* | | tgt | | */
19872006
/* +----------+-------+----------------+ */
19882007
le = lext_create(tgt);
2008+
M0_ASSERT(le != NULL);
19892009
if (le == NULL)
19902010
return M0_RC(-ENOMEM);
19912011
rc = balloc_ext_insert(db, tx, *tgt);
2012+
M0_ASSERT(rc == 0);
19922013
if (rc != 0) {
19932014
m0_free(le);
19942015
return M0_RC(rc);
@@ -2078,6 +2099,7 @@ static int balloc_find_by_goal(struct m0_balloc_allocation_context *bac)
20782099

20792100
ret = balloc_alloc_db_update(bac->bac_ctxt, tx, grp,
20802101
&bac->bac_final);
2102+
M0_ASSERT(ret == 0);
20812103
}
20822104

20832105
m0_balloc_release_extents(grp);
@@ -2445,6 +2467,7 @@ static int balloc_try_best_found(struct balloc_allocation_context *bac,
24452467
&cur));
24462468
rc = balloc_alloc_db_update(bac->bac_ctxt, bac->bac_tx, grp,
24472469
&bac->bac_final, alloc_flag, cur);
2470+
M0_ASSERT(rc == 0);
24482471
}
24492472
out:
24502473
m0_balloc_unlock_group(grp);
@@ -2646,6 +2669,7 @@ static int allocate_blocks(int cr, struct balloc_allocation_context *bac,
26462669
&cur));
26472670
rc = balloc_alloc_db_update(bac->bac_ctxt, bac->bac_tx, grp,
26482671
&bac->bac_final, alloc_type, cur);
2672+
M0_ASSERT(rc == 0);
26492673
}
26502674
return rc;
26512675
}
@@ -2790,16 +2814,19 @@ static int balloc_free_internal(struct m0_balloc *ctx,
27902814
fex.e_end = grp->bgi_spare.bzp_range.e_start;
27912815
rc = balloc_free_db_update(ctx, tx, grp, &fex,
27922816
M0_BALLOC_NORMAL_ZONE);
2817+
M0_ASSERT(rc == 0);
27932818
if (rc != 0)
27942819
break;
27952820
fex.e_start = zone_start_get(grp,
27962821
M0_BALLOC_SPARE_ZONE);
27972822
fex.e_end = start + step;
27982823
alloc_flag = M0_BALLOC_SPARE_ZONE;
27992824
}
2800-
if (rc == 0)
2825+
if (rc == 0) {
28012826
rc = balloc_free_db_update(ctx, tx, grp, &fex,
28022827
alloc_flag);
2828+
M0_ASSERT(rc == 0);
2829+
}
28032830
m0_balloc_unlock_group(grp);
28042831
start += step;
28052832
len -= step;
@@ -2936,6 +2963,7 @@ static int balloc_reserve_extent(struct m0_ad_balloc *ballroom,
29362963
}
29372964

29382965
rc = balloc_alloc_db_update(ctx, tx, grp, ext, alloc_zone, cur);
2966+
M0_ASSERT(rc == 0);
29392967

29402968
out_unlock:
29412969
m0_balloc_unlock_group(grp);

balloc/ut/balloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ int test_balloc_ut_ops(struct m0_be_ut_backend *ut_be, struct m0_be_seg *seg,
118118
grp = m0_be_ut_backend_sm_group_lookup(ut_be);
119119
rc = m0_balloc_create(0, seg, grp, &motr_balloc, &M0_FID_INIT(0, 1));
120120
M0_UT_ASSERT(rc == 0);
121+
motr_balloc->cb_ballroom.ab_ops->bo_fini(&motr_balloc->cb_ballroom);
121122

122123
rc = motr_balloc->cb_ballroom.ab_ops->bo_init
123124
(&motr_balloc->cb_ballroom, seg, BALLOC_DEF_BLOCK_SHIFT,

0 commit comments

Comments
 (0)