@@ -1446,6 +1446,10 @@ void __aafs_profile_migrate_dents(struct aa_profile *old,
1446
1446
{
1447
1447
int i ;
1448
1448
1449
+ AA_BUG (!old );
1450
+ AA_BUG (!new );
1451
+ AA_BUG (!mutex_is_locked (& profiles_ns (old )-> lock ));
1452
+
1449
1453
for (i = 0 ; i < AAFS_PROF_SIZEOF ; i ++ ) {
1450
1454
new -> dents [i ] = old -> dents [i ];
1451
1455
if (new -> dents [i ])
@@ -1509,6 +1513,9 @@ int __aafs_profile_mkdir(struct aa_profile *profile, struct dentry *parent)
1509
1513
struct dentry * dent = NULL , * dir ;
1510
1514
int error ;
1511
1515
1516
+ AA_BUG (!profile );
1517
+ AA_BUG (!mutex_is_locked (& profiles_ns (profile )-> lock ));
1518
+
1512
1519
if (!parent ) {
1513
1520
struct aa_profile * p ;
1514
1521
p = aa_deref_parent (profile );
@@ -1734,6 +1741,7 @@ void __aafs_ns_rmdir(struct aa_ns *ns)
1734
1741
1735
1742
if (!ns )
1736
1743
return ;
1744
+ AA_BUG (!mutex_is_locked (& ns -> lock ));
1737
1745
1738
1746
list_for_each_entry (child , & ns -> base .profiles , base .list )
1739
1747
__aafs_profile_rmdir (child );
@@ -1906,6 +1914,10 @@ static struct aa_ns *__next_ns(struct aa_ns *root, struct aa_ns *ns)
1906
1914
{
1907
1915
struct aa_ns * parent , * next ;
1908
1916
1917
+ AA_BUG (!root );
1918
+ AA_BUG (!ns );
1919
+ AA_BUG (ns != root && !mutex_is_locked (& ns -> parent -> lock ));
1920
+
1909
1921
/* is next namespace a child */
1910
1922
if (!list_empty (& ns -> sub_ns )) {
1911
1923
next = list_first_entry (& ns -> sub_ns , typeof (* ns ), base .list );
@@ -1940,6 +1952,9 @@ static struct aa_ns *__next_ns(struct aa_ns *root, struct aa_ns *ns)
1940
1952
static struct aa_profile * __first_profile (struct aa_ns * root ,
1941
1953
struct aa_ns * ns )
1942
1954
{
1955
+ AA_BUG (!root );
1956
+ AA_BUG (ns && !mutex_is_locked (& ns -> lock ));
1957
+
1943
1958
for (; ns ; ns = __next_ns (root , ns )) {
1944
1959
if (!list_empty (& ns -> base .profiles ))
1945
1960
return list_first_entry (& ns -> base .profiles ,
@@ -1962,6 +1977,8 @@ static struct aa_profile *__next_profile(struct aa_profile *p)
1962
1977
struct aa_profile * parent ;
1963
1978
struct aa_ns * ns = p -> ns ;
1964
1979
1980
+ AA_BUG (!mutex_is_locked (& profiles_ns (p )-> lock ));
1981
+
1965
1982
/* is next profile a child */
1966
1983
if (!list_empty (& p -> base .profiles ))
1967
1984
return list_first_entry (& p -> base .profiles , typeof (* p ),
0 commit comments