Whamcloud - gitweb
LU-6722 ldiskfs: fix credits at ldiskfs_delete_inode
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel6.3 / ext4-pdir-fix.patch
1 Index: linux-stage/fs/ext4/ext4.h
2 ===================================================================
3 --- linux-stage.orig/fs/ext4/ext4.h     2012-08-07 11:52:38.994200699 -0700
4 +++ linux-stage/fs/ext4/ext4.h  2012-08-07 12:28:19.497442862 -0700
5 @@ -706,6 +707,9 @@
6         __u32   i_dtime;
7         ext4_fsblk_t    i_file_acl;
8  
9 +       /* following fields for parallel directory operations -bzzz */
10 +       struct semaphore i_append_sem;
11 +
12         /*
13          * i_block_group is the number of the block group which contains
14          * this file's inode.  Constant across the lifetime of the inode,
15 Index: linux-stage/fs/ext4/namei.c
16 ===================================================================
17 --- linux-stage.orig/fs/ext4/namei.c    2012-08-07 11:52:38.992199430 -0700
18 +++ linux-stage/fs/ext4/namei.c 2012-08-07 12:27:24.845281099 -0700
19 @@ -53,6 +53,11 @@
20                                         ext4_lblk_t *block, int *err)
21  {
22         struct buffer_head *bh;
23 +       struct ext4_inode_info *ei = EXT4_I(inode);
24 +
25 +       /* with parallel dir operations all appends
26 +       * have to be serialized -bzzz */
27 +       down(&ei->i_append_sem);
28  
29         *block = inode->i_size >> inode->i_sb->s_blocksize_bits;
30  
31 @@ -65,7 +70,9 @@
32                         brelse(bh);
33                         bh = NULL;
34                 }
35 +               ei->i_disksize = inode->i_size;
36         }
37 +       up(&ei->i_append_sem);
38         return bh;
39  }
40  
41 Index: linux-stage/fs/ext4/super.c
42 ===================================================================
43 --- linux-stage.orig/fs/ext4/super.c    2012-08-07 11:52:39.009197356 -0700
44 +++ linux-stage/fs/ext4/super.c 2012-08-07 12:28:29.499112997 -0700
45 @@ -749,6 +749,7 @@
46  
47         ei->vfs_inode.i_version = 1;
48         ei->vfs_inode.i_data.writeback_index = 0;
49 +       sema_init(&ei->i_append_sem, 1);
50         memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache));
51         INIT_LIST_HEAD(&ei->i_prealloc_list);
52         spin_lock_init(&ei->i_prealloc_lock);