• Alexander Viro's avatar
    [PATCH] (1/3) fs/super.c cleanups · ad9e3359
    Alexander Viro authored
    * missing yield() added to grab_super() (on failure exit).  Without
      that we have a nasty race - if get_sb_bdev() happens just before
      we grab ->s_umount in kill_super(), we are going to have
      get_sb_bdev() spinning indefinitely long without yielding CPU,
      so that kill_super() could make progress (and break the loop).
    
    * in kill_super() code that does actual superblock shutdown is
      wrapped in if (sb->s_root) {}.  That condition is true for
      all old callers of kill_super(), so we don't change existing
      behaviour.
    
    * instances of deactivate_super()/remove_super() (after failed
      call of foo_fill_super()) are replaced with
    	up_write(&s->s_umount);
    	kill_super(s);
      - now it becomes legitimate (kill_super() works on such guys and
      does exactly what we want).
    ad9e3359
super.c 20.5 KB