@@ -1847,15 +1847,13 @@ static bool has_uuid_at_pos(struct nd_region *nd_region, u8 *uuid,
1847
1847
list_for_each_entry (label_ent , & nd_mapping -> labels , list ) {
1848
1848
struct nd_namespace_label * nd_label = label_ent -> label ;
1849
1849
u16 position , nlabel ;
1850
- u64 isetcookie ;
1851
1850
1852
1851
if (!nd_label )
1853
1852
continue ;
1854
- isetcookie = nsl_get_isetcookie (ndd , nd_label );
1855
1853
position = nsl_get_position (ndd , nd_label );
1856
1854
nlabel = nsl_get_nlabel (ndd , nd_label );
1857
1855
1858
- if (isetcookie != cookie )
1856
+ if (! nsl_validate_isetcookie ( ndd , nd_label , cookie ) )
1859
1857
continue ;
1860
1858
1861
1859
if (memcmp (nd_label -> uuid , uuid , NSLABEL_UUID_LEN ) != 0 )
@@ -1968,10 +1966,10 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region,
1968
1966
return ERR_PTR (- ENXIO );
1969
1967
}
1970
1968
1971
- if (nsl_get_isetcookie (ndd , nd_label ) != cookie ) {
1969
+ if (! nsl_validate_isetcookie (ndd , nd_label , cookie ) ) {
1972
1970
dev_dbg (& nd_region -> dev , "invalid cookie in label: %pUb\n" ,
1973
1971
nd_label -> uuid );
1974
- if (nsl_get_isetcookie (ndd , nd_label ) != altcookie )
1972
+ if (! nsl_validate_isetcookie (ndd , nd_label , altcookie ) )
1975
1973
return ERR_PTR (- EAGAIN );
1976
1974
1977
1975
dev_dbg (& nd_region -> dev , "valid altcookie in label: %pUb\n" ,
0 commit comments