Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 18 Mar 2011 00:41:19 +0000 (17:41 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 18 Mar 2011 00:41:19 +0000 (17:41 -0700)
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
  ext3: Always set dx_node's fake_dirent explicitly.
  ext3: Fix an overflow in ext3_trim_fs.
  jbd: Remove one to many n's in a word.
  ext3: skip orphan cleanup on rocompat fs
  ext2: Fix link count corruption under heavy link+rename load
  ext3: speed up group trim with the right free block count.
  ext3: Adjust trim start with first_data_block.
  quota: return -ENOMEM when memory allocation fails

1  2 
fs/ext3/namei.c
fs/ext3/super.c

diff --combined fs/ext3/namei.c
index 0521a007ae6defc3434f501850c72682a83398eb,75c968eaf90d29e67167ed519e53f949b336a57b..32f3b869585927400a035259c0fee27e312b39c8
@@@ -1540,8 -1540,8 +1540,8 @@@ static int ext3_dx_add_entry(handle_t *
                        goto cleanup;
                node2 = (struct dx_node *)(bh2->b_data);
                entries2 = node2->entries;
+               memset(&node2->fake, 0, sizeof(struct fake_dirent));
                node2->fake.rec_len = ext3_rec_len_to_disk(sb->s_blocksize);
-               node2->fake.inode = 0;
                BUFFER_TRACE(frame->bh, "get_write_access");
                err = ext3_journal_get_write_access(handle, frame->bh);
                if (err)
@@@ -1710,7 -1710,7 +1710,7 @@@ retry
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
 -      inode = ext3_new_inode (handle, dir, mode);
 +      inode = ext3_new_inode (handle, dir, &dentry->d_name, mode);
        err = PTR_ERR(inode);
        if (!IS_ERR(inode)) {
                inode->i_op = &ext3_file_inode_operations;
@@@ -1746,7 -1746,7 +1746,7 @@@ retry
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
 -      inode = ext3_new_inode (handle, dir, mode);
 +      inode = ext3_new_inode (handle, dir, &dentry->d_name, mode);
        err = PTR_ERR(inode);
        if (!IS_ERR(inode)) {
                init_special_inode(inode, inode->i_mode, rdev);
@@@ -1784,7 -1784,7 +1784,7 @@@ retry
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
 -      inode = ext3_new_inode (handle, dir, S_IFDIR | mode);
 +      inode = ext3_new_inode (handle, dir, &dentry->d_name, S_IFDIR | mode);
        err = PTR_ERR(inode);
        if (IS_ERR(inode))
                goto out_stop;
@@@ -2206,7 -2206,7 +2206,7 @@@ retry
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
 -      inode = ext3_new_inode (handle, dir, S_IFLNK|S_IRWXUGO);
 +      inode = ext3_new_inode (handle, dir, &dentry->d_name, S_IFLNK|S_IRWXUGO);
        err = PTR_ERR(inode);
        if (IS_ERR(inode))
                goto out_stop;
@@@ -2253,6 -2253,13 +2253,6 @@@ static int ext3_link (struct dentry * o
  
        dquot_initialize(dir);
  
 -      /*
 -       * Return -ENOENT if we've raced with unlink and i_nlink is 0.  Doing
 -       * otherwise has the potential to corrupt the orphan inode list.
 -       */
 -      if (inode->i_nlink == 0)
 -              return -ENOENT;
 -
  retry:
        handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) +
                                        EXT3_INDEX_EXTRA_TRANS_BLOCKS);
diff --combined fs/ext3/super.c
index 9cc19a1dea8ecb4276715bc920f02956290f74f7,0d62f29f213a18dbd029c7dbde0d0a7501e3e13e..071689f86e18bf8991f3d43f528d3fee8b06d6af
@@@ -1462,6 -1462,13 +1462,13 @@@ static void ext3_orphan_cleanup (struc
                ext3_msg(sb, KERN_ERR, "error: write access "
                        "unavailable, skipping orphan cleanup.");
                return;
+       }
+       /* Check if feature set allows readwrite operations */
+       if (EXT3_HAS_RO_COMPAT_FEATURE(sb, ~EXT3_FEATURE_RO_COMPAT_SUPP)) {
+               ext3_msg(sb, KERN_INFO, "Skipping orphan cleanup due to "
+                        "unknown ROCOMPAT features");
+               return;
        }
  
        if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) {
@@@ -1936,7 -1943,6 +1943,7 @@@ static int ext3_fill_super (struct supe
        sb->s_qcop = &ext3_qctl_operations;
        sb->dq_op = &ext3_quota_operations;
  #endif
 +      memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid));
        INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
        mutex_init(&sbi->s_orphan_lock);
        mutex_init(&sbi->s_resize_lock);