Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / ext3-xattr-ptr-arith-fix.patch
1 Index: linux-2.4.20/fs/ext3/xattr.c
2 ===================================================================
3 --- linux-2.4.20.orig/fs/ext3/xattr.c   2003-11-13 10:59:33.000000000 +0800
4 +++ linux-2.4.20/fs/ext3/xattr.c        2003-11-25 21:16:51.000000000 +0800
5 @@ -1293,9 +1293,10 @@
6                                 goto cleanup;
7                         memcpy(header, HDR(bh), bh->b_size);
8                         header->h_refcount = cpu_to_le32(1);
9 -                       offset = (char *)header - bh->b_data;
10 -                       here = ENTRY((char *)here + offset);
11 -                       last = ENTRY((char *)last + offset);
12 +                       offset = (char *)here - bh->b_data;
13 +                       here = ENTRY((char *)header + offset);
14 +                       offset = (char *)last - bh->b_data;
15 +                       last = ENTRY((char *)header + offset);
16                 }
17         } else {
18                 /* Allocate a buffer where we construct the new block. */