@@ -1593,15 +1593,18 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
1593
1593
int ret ;
1594
1594
1595
1595
prdtgrp = rdtgroup_kn_lock_live (prgrp_kn );
1596
+ rdt_last_cmd_clear ();
1596
1597
if (!prdtgrp ) {
1597
1598
ret = - ENODEV ;
1599
+ rdt_last_cmd_puts ("directory was removed\n" );
1598
1600
goto out_unlock ;
1599
1601
}
1600
1602
1601
1603
/* allocate the rdtgroup. */
1602
1604
rdtgrp = kzalloc (sizeof (* rdtgrp ), GFP_KERNEL );
1603
1605
if (!rdtgrp ) {
1604
1606
ret = - ENOSPC ;
1607
+ rdt_last_cmd_puts ("kernel out of memory\n" );
1605
1608
goto out_unlock ;
1606
1609
}
1607
1610
* r = rdtgrp ;
@@ -1613,6 +1616,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
1613
1616
kn = kernfs_create_dir (parent_kn , name , mode , rdtgrp );
1614
1617
if (IS_ERR (kn )) {
1615
1618
ret = PTR_ERR (kn );
1619
+ rdt_last_cmd_puts ("kernfs create error\n" );
1616
1620
goto out_free_rgrp ;
1617
1621
}
1618
1622
rdtgrp -> kn = kn ;
@@ -1626,24 +1630,32 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
1626
1630
kernfs_get (kn );
1627
1631
1628
1632
ret = rdtgroup_kn_set_ugid (kn );
1629
- if (ret )
1633
+ if (ret ) {
1634
+ rdt_last_cmd_puts ("kernfs perm error\n" );
1630
1635
goto out_destroy ;
1636
+ }
1631
1637
1632
1638
files = RFTYPE_BASE | RFTYPE_CTRL ;
1633
1639
files = RFTYPE_BASE | BIT (RF_CTRLSHIFT + rtype );
1634
1640
ret = rdtgroup_add_files (kn , files );
1635
- if (ret )
1641
+ if (ret ) {
1642
+ rdt_last_cmd_puts ("kernfs fill error\n" );
1636
1643
goto out_destroy ;
1644
+ }
1637
1645
1638
1646
if (rdt_mon_capable ) {
1639
1647
ret = alloc_rmid ();
1640
- if (ret < 0 )
1648
+ if (ret < 0 ) {
1649
+ rdt_last_cmd_puts ("out of RMIDs\n" );
1641
1650
goto out_destroy ;
1651
+ }
1642
1652
rdtgrp -> mon .rmid = ret ;
1643
1653
1644
1654
ret = mkdir_mondata_all (kn , rdtgrp , & rdtgrp -> mon .mon_data_kn );
1645
- if (ret )
1655
+ if (ret ) {
1656
+ rdt_last_cmd_puts ("kernfs subdir error\n" );
1646
1657
goto out_idfree ;
1658
+ }
1647
1659
}
1648
1660
kernfs_activate (kn );
1649
1661
@@ -1721,8 +1733,10 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn,
1721
1733
1722
1734
kn = rdtgrp -> kn ;
1723
1735
ret = closid_alloc ();
1724
- if (ret < 0 )
1736
+ if (ret < 0 ) {
1737
+ rdt_last_cmd_puts ("out of CLOSIDs\n" );
1725
1738
goto out_common_fail ;
1739
+ }
1726
1740
closid = ret ;
1727
1741
1728
1742
rdtgrp -> closid = closid ;
@@ -1734,8 +1748,10 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn,
1734
1748
* of tasks and cpus to monitor.
1735
1749
*/
1736
1750
ret = mongroup_create_dir (kn , NULL , "mon_groups" , NULL );
1737
- if (ret )
1751
+ if (ret ) {
1752
+ rdt_last_cmd_puts ("kernfs subdir error\n" );
1738
1753
goto out_id_free ;
1754
+ }
1739
1755
}
1740
1756
1741
1757
goto out_unlock ;
0 commit comments