These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / fs / nilfs2 / super.c
index f47585b..354013e 100644 (file)
@@ -361,7 +361,7 @@ static int nilfs_move_2nd_super(struct super_block *sb, loff_t sb2off)
        struct nilfs_super_block *nsbp;
        sector_t blocknr, newblocknr;
        unsigned long offset;
-       int sb2i = -1;  /* array index of the secondary superblock */
+       int sb2i;  /* array index of the secondary superblock */
        int ret = 0;
 
        /* nilfs->ns_sem must be locked by the caller. */
@@ -372,6 +372,9 @@ static int nilfs_move_2nd_super(struct super_block *sb, loff_t sb2off)
        } else if (nilfs->ns_sbh[0]->b_blocknr > nilfs->ns_first_data_block) {
                sb2i = 0;
                blocknr = nilfs->ns_sbh[0]->b_blocknr;
+       } else {
+               sb2i = -1;
+               blocknr = 0;
        }
        if (sb2i >= 0 && (u64)blocknr << nilfs->ns_blocksize_bits == sb2off)
                goto out;  /* super block location is unchanged */
@@ -1405,14 +1408,10 @@ static void nilfs_destroy_cachep(void)
         */
        rcu_barrier();
 
-       if (nilfs_inode_cachep)
-               kmem_cache_destroy(nilfs_inode_cachep);
-       if (nilfs_transaction_cachep)
-               kmem_cache_destroy(nilfs_transaction_cachep);
-       if (nilfs_segbuf_cachep)
-               kmem_cache_destroy(nilfs_segbuf_cachep);
-       if (nilfs_btree_path_cache)
-               kmem_cache_destroy(nilfs_btree_path_cache);
+       kmem_cache_destroy(nilfs_inode_cachep);
+       kmem_cache_destroy(nilfs_transaction_cachep);
+       kmem_cache_destroy(nilfs_segbuf_cachep);
+       kmem_cache_destroy(nilfs_btree_path_cache);
 }
 
 static int __init nilfs_init_cachep(void)