Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Branch b1_6
[fs/lustre-release.git]
/
ldiskfs
/
kernel_patches
/
patches
/
ext3-mballoc3-core.patch
diff --git
a/ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch
b/ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch
index
7396e67
..
f1d9bd6
100644
(file)
--- a/
ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch
+++ b/
ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch
@@
-183,7
+183,7
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
===================================================================
--- linux-2.6.9-full.orig/fs/ext3/mballoc.c 2007-10-17 21:59:51.072534980 +0400
+++ linux-2.6.9-full/fs/ext3/mballoc.c 2007-10-17 23:09:22.000000000 +0400
===================================================================
--- linux-2.6.9-full.orig/fs/ext3/mballoc.c 2007-10-17 21:59:51.072534980 +0400
+++ linux-2.6.9-full/fs/ext3/mballoc.c 2007-10-17 23:09:22.000000000 +0400
-@@ -0,0 +1,4
404
@@
+@@ -0,0 +1,4
398
@@
+/*
+ * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
+ * Written by Alex Tomas <alex@clusterfs.com>
+/*
+ * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
+ * Written by Alex Tomas <alex@clusterfs.com>
@@
-2389,8
+2389,8
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ spin_lock_init(&sbi->s_mb_history_lock);
+ i = sbi->s_mb_history_max * sizeof(struct ext3_mb_history);
+ sbi->s_mb_history = kmalloc(i, GFP_KERNEL);
+ spin_lock_init(&sbi->s_mb_history_lock);
+ i = sbi->s_mb_history_max * sizeof(struct ext3_mb_history);
+ sbi->s_mb_history = kmalloc(i, GFP_KERNEL);
-+
if (likely(sbi->s_mb_history != NULL))
-+
memset(sbi->s_mb_history, 0, i);
++ if (likely(sbi->s_mb_history != NULL))
++ memset(sbi->s_mb_history, 0, i);
+ /* if we can't allocate history, then we simple won't use it */
+}
+
+ /* if we can't allocate history, then we simple won't use it */
+}
+
@@
-2600,7
+2600,7
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ sbi->s_mb_order2_reqs = MB_DEFAULT_ORDER2_REQS;
+ sbi->s_mb_history_filter = EXT3_MB_HISTORY_DEFAULT;
+
+ sbi->s_mb_order2_reqs = MB_DEFAULT_ORDER2_REQS;
+ sbi->s_mb_history_filter = EXT3_MB_HISTORY_DEFAULT;
+
-+ i = sizeof(struct ext3_locality_group) *
NR_CPUS
;
++ i = sizeof(struct ext3_locality_group) *
num_possible_cpus()
;
+ sbi->s_locality_groups = kmalloc(i, GFP_NOFS);
+ if (sbi->s_locality_groups == NULL) {
+ clear_opt(sbi->s_mount_opt, MBALLOC);
+ sbi->s_locality_groups = kmalloc(i, GFP_NOFS);
+ if (sbi->s_locality_groups == NULL) {
+ clear_opt(sbi->s_mount_opt, MBALLOC);
@@
-2608,7
+2608,7
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ kfree(sbi->s_mb_maxs);
+ return -ENOMEM;
+ }
+ kfree(sbi->s_mb_maxs);
+ return -ENOMEM;
+ }
-+ for (i = 0; i <
NR_CPUS
; i++) {
++ for (i = 0; i <
num_possible_cpus()
; i++) {
+ struct ext3_locality_group *lg;
+ lg = &sbi->s_locality_groups[i];
+ sema_init(&lg->lg_sem, 1);
+ struct ext3_locality_group *lg;
+ lg = &sbi->s_locality_groups[i];
+ sema_init(&lg->lg_sem, 1);
@@
-3615,7
+3615,7
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ BUG_ON(ac->ac_status != AC_STATUS_FOUND);
+ BUG_ON(!S_ISREG(ac->ac_inode->i_mode));
+
+ BUG_ON(ac->ac_status != AC_STATUS_FOUND);
+ BUG_ON(!S_ISREG(ac->ac_inode->i_mode));
+
-+ pa = kmem_cache_alloc(ext3_pspace_cachep,
SLAB
_NOFS);
++ pa = kmem_cache_alloc(ext3_pspace_cachep,
GFP
_NOFS);
+ if (pa == NULL)
+ return -ENOMEM;
+
+ if (pa == NULL)
+ return -ENOMEM;
+
@@
-3700,7
+3700,7
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ BUG_ON(!S_ISREG(ac->ac_inode->i_mode));
+
+ BUG_ON(ext3_pspace_cachep == NULL);
+ BUG_ON(!S_ISREG(ac->ac_inode->i_mode));
+
+ BUG_ON(ext3_pspace_cachep == NULL);
-+ pa = kmem_cache_alloc(ext3_pspace_cachep,
SLAB
_NOFS);
++ pa = kmem_cache_alloc(ext3_pspace_cachep,
GFP
_NOFS);
+ if (pa == NULL)
+ return -ENOMEM;
+
+ if (pa == NULL)
+ return -ENOMEM;
+
@@
-3889,8
+3889,6
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ spin_lock(&pa->pa_lock);
+ if (atomic_read(&pa->pa_count)) {
+ spin_unlock(&pa->pa_lock);
+ spin_lock(&pa->pa_lock);
+ if (atomic_read(&pa->pa_count)) {
+ spin_unlock(&pa->pa_lock);
-+ printk("uh! busy PA\n");
-+ dump_stack();
+ busy = 1;
+ continue;
+ }
+ busy = 1;
+ continue;
+ }
@@
-3983,8
+3981,6
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ * use preallocation while we're discarding it */
+ spin_unlock(&pa->pa_lock);
+ spin_unlock(&ei->i_prealloc_lock);
+ * use preallocation while we're discarding it */
+ spin_unlock(&pa->pa_lock);
+ spin_unlock(&ei->i_prealloc_lock);
-+ printk("uh-oh! used pa while discarding\n");
-+ dump_stack();
+ current->state = TASK_UNINTERRUPTIBLE;
+ schedule_timeout(HZ);
+ goto repeat;
+ current->state = TASK_UNINTERRUPTIBLE;
+ schedule_timeout(HZ);
+ goto repeat;
@@
-4014,8
+4010,6
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ * add a flag to force wait only in case
+ * of ->clear_inode(), but not in case of
+ * regular truncate */
+ * add a flag to force wait only in case
+ * of ->clear_inode(), but not in case of
+ * regular truncate */
-+ printk("uh-oh! some one just deleted it\n");
-+ dump_stack();
+ current->state = TASK_UNINTERRUPTIBLE;
+ schedule_timeout(HZ);
+ goto repeat;
+ current->state = TASK_UNINTERRUPTIBLE;
+ schedule_timeout(HZ);
+ goto repeat;
@@
-4030,15
+4024,15
@@
Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ BUG_ON(err != 0); /* error handling here */
+
+ bitmap_bh = read_block_bitmap(sb, group);
+ BUG_ON(err != 0); /* error handling here */
+
+ bitmap_bh = read_block_bitmap(sb, group);
-+ if (bitmap_bh == NULL) {
-+ /* error handling here */
-+ ext3_mb_release_desc(&e3b);
-+ BUG_ON(bitmap_bh == NULL);
-+ }
+
+ ext3_lock_group(sb, group);
+ list_del_rcu(&pa->pa_group_list);
+
+ ext3_lock_group(sb, group);
+ list_del_rcu(&pa->pa_group_list);
-+ ext3_mb_release_inode_pa(&e3b, bitmap_bh, pa);
++
++ /* can be NULL due to IO error, at worst
++ * we leave some free blocks unavailable
++ * do not go RO - no need for */
++ if (bitmap_bh != NULL)
++ ext3_mb_release_inode_pa(&e3b, bitmap_bh, pa);
+ ext3_unlock_group(sb, group);
+
+ ext3_mb_release_desc(&e3b);
+ ext3_unlock_group(sb, group);
+
+ ext3_mb_release_desc(&e3b);