File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -383,9 +383,11 @@ static int kernfs_link_sibling(struct kernfs_node *kn)
383
383
rb_insert_color (& kn -> rb , & kn -> parent -> dir .children );
384
384
385
385
/* successfully added, account subdir number */
386
+ down_write (& kernfs_root (kn )-> kernfs_iattr_rwsem );
386
387
if (kernfs_type (kn ) == KERNFS_DIR )
387
388
kn -> parent -> dir .subdirs ++ ;
388
389
kernfs_inc_rev (kn -> parent );
390
+ up_write (& kernfs_root (kn )-> kernfs_iattr_rwsem );
389
391
390
392
return 0 ;
391
393
}
@@ -408,9 +410,11 @@ static bool kernfs_unlink_sibling(struct kernfs_node *kn)
408
410
if (RB_EMPTY_NODE (& kn -> rb ))
409
411
return false;
410
412
413
+ down_write (& kernfs_root (kn )-> kernfs_iattr_rwsem );
411
414
if (kernfs_type (kn ) == KERNFS_DIR )
412
415
kn -> parent -> dir .subdirs -- ;
413
416
kernfs_inc_rev (kn -> parent );
417
+ up_write (& kernfs_root (kn )-> kernfs_iattr_rwsem );
414
418
415
419
rb_erase (& kn -> rb , & kn -> parent -> dir .children );
416
420
RB_CLEAR_NODE (& kn -> rb );
You can’t perform that action at this time.
0 commit comments