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