Skip to content
Snippets Groups Projects
Commit 3fccd3ea authored by alex's avatar alex
Browse files

b=12903

i=kalpak
i=johann

 - skip PAs being destroyed in normalization path
 - drop group lock in discard group preallocation path to avoid deadlock
parent 00ec37da
No related branches found
No related tags found
No related merge requests found
Index: linux-2.6.9-full/include/linux/ext3_fs.h Index: linux-2.6.9-full/include/linux/ext3_fs.h
=================================================================== ===================================================================
--- linux-2.6.9-full.orig/include/linux/ext3_fs.h 2007-06-08 23:44:08.000000000 +0400 --- linux-2.6.9-full.orig/include/linux/ext3_fs.h 2007-06-08 23:44:08.000000000 +0400
+++ linux-2.6.9-full/include/linux/ext3_fs.h 2007-06-29 11:31:13.000000000 +0400 +++ linux-2.6.9-full/include/linux/ext3_fs.h 2007-07-19 09:39:07.000000000 +0400
@@ -57,6 +57,30 @@ struct statfs; @@ -57,6 +57,30 @@ struct statfs;
#define ext3_debug(f, a...) do {} while (0) #define ext3_debug(f, a...) do {} while (0)
#endif #endif
...@@ -72,7 +72,7 @@ Index: linux-2.6.9-full/include/linux/ext3_fs.h ...@@ -72,7 +72,7 @@ Index: linux-2.6.9-full/include/linux/ext3_fs.h
Index: linux-2.6.9-full/include/linux/ext3_fs_sb.h Index: linux-2.6.9-full/include/linux/ext3_fs_sb.h
=================================================================== ===================================================================
--- linux-2.6.9-full.orig/include/linux/ext3_fs_sb.h 2007-06-08 23:44:07.000000000 +0400 --- linux-2.6.9-full.orig/include/linux/ext3_fs_sb.h 2007-06-08 23:44:07.000000000 +0400
+++ linux-2.6.9-full/include/linux/ext3_fs_sb.h 2007-06-29 11:31:13.000000000 +0400 +++ linux-2.6.9-full/include/linux/ext3_fs_sb.h 2007-07-19 09:39:07.000000000 +0400
@@ -81,6 +81,61 @@ struct ext3_sb_info { @@ -81,6 +81,61 @@ struct ext3_sb_info {
char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
int s_jquota_fmt; /* Format of quota to use */ int s_jquota_fmt; /* Format of quota to use */
...@@ -138,7 +138,7 @@ Index: linux-2.6.9-full/include/linux/ext3_fs_sb.h ...@@ -138,7 +138,7 @@ Index: linux-2.6.9-full/include/linux/ext3_fs_sb.h
Index: linux-2.6.9-full/fs/ext3/super.c Index: linux-2.6.9-full/fs/ext3/super.c
=================================================================== ===================================================================
--- linux-2.6.9-full.orig/fs/ext3/super.c 2007-06-08 23:44:08.000000000 +0400 --- linux-2.6.9-full.orig/fs/ext3/super.c 2007-06-08 23:44:08.000000000 +0400
+++ linux-2.6.9-full/fs/ext3/super.c 2007-06-29 11:31:13.000000000 +0400 +++ linux-2.6.9-full/fs/ext3/super.c 2007-07-19 09:39:07.000000000 +0400
@@ -394,6 +394,7 @@ void ext3_put_super (struct super_block @@ -394,6 +394,7 @@ void ext3_put_super (struct super_block
struct ext3_super_block *es = sbi->s_es; struct ext3_super_block *es = sbi->s_es;
int i; int i;
...@@ -181,9 +181,9 @@ Index: linux-2.6.9-full/fs/ext3/super.c ...@@ -181,9 +181,9 @@ Index: linux-2.6.9-full/fs/ext3/super.c
int ext3_prep_san_write(struct inode *inode, long *blocks, int ext3_prep_san_write(struct inode *inode, long *blocks,
Index: linux-2.6.9-full/fs/ext3/mballoc.c Index: linux-2.6.9-full/fs/ext3/mballoc.c
=================================================================== ===================================================================
--- linux-2.6.9-full.orig/fs/ext3/mballoc.c 2007-06-17 11:25:39.317298699 +0400 --- linux-2.6.9-full.orig/fs/ext3/mballoc.c 2007-07-14 04:24:39.138985848 +0400
+++ linux-2.6.9-full/fs/ext3/mballoc.c 2007-06-29 12:06:50.000000000 +0400 +++ linux-2.6.9-full/fs/ext3/mballoc.c 2007-07-20 11:31:03.000000000 +0400
@@ -0,0 +1,4371 @@ @@ -0,0 +1,4391 @@
+/* +/*
+ * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com + * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
+ * Written by Alex Tomas <alex@clusterfs.com> + * Written by Alex Tomas <alex@clusterfs.com>
...@@ -3273,6 +3273,15 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c ...@@ -3273,6 +3273,15 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ unsigned long pa_end; + unsigned long pa_end;
+ +
+ pa = list_entry(cur, struct ext3_prealloc_space, pa_inode_list); + pa = list_entry(cur, struct ext3_prealloc_space, pa_inode_list);
+
+ if (pa->pa_deleted)
+ continue;
+ spin_lock(&pa->pa_lock);
+ if (pa->pa_deleted) {
+ spin_unlock(&pa->pa_lock);
+ continue;
+ }
+
+ pa_end = pa->pa_lstart + pa->pa_len; + pa_end = pa->pa_lstart + pa->pa_len;
+ +
+ /* PA must not overlap original request */ + /* PA must not overlap original request */
...@@ -3280,10 +3289,14 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c ...@@ -3280,10 +3289,14 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ ac->ac_o_ex.fe_logical < pa->pa_lstart)); + ac->ac_o_ex.fe_logical < pa->pa_lstart));
+ +
+ /* skip PA normalized request doesn't overlap with */ + /* skip PA normalized request doesn't overlap with */
+ if (pa->pa_lstart >= end) + if (pa->pa_lstart >= end) {
+ spin_unlock(&pa->pa_lock);
+ continue; + continue;
+ if (pa_end <= start) + }
+ if (pa_end <= start) {
+ spin_unlock(&pa->pa_lock);
+ continue; + continue;
+ }
+ BUG_ON(pa->pa_lstart <= start && pa_end >= end); + BUG_ON(pa->pa_lstart <= start && pa_end >= end);
+ +
+ if (pa_end <= ac->ac_o_ex.fe_logical) { + if (pa_end <= ac->ac_o_ex.fe_logical) {
...@@ -3295,6 +3308,7 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c ...@@ -3295,6 +3308,7 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ BUG_ON(pa->pa_lstart > end); + BUG_ON(pa->pa_lstart > end);
+ end = pa->pa_lstart; + end = pa->pa_lstart;
+ } + }
+ spin_unlock(&pa->pa_lock);
+ } + }
+ rcu_read_unlock(); + rcu_read_unlock();
+ size = end - start; + size = end - start;
...@@ -3305,8 +3319,12 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c ...@@ -3305,8 +3319,12 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ struct ext3_prealloc_space *pa; + struct ext3_prealloc_space *pa;
+ unsigned long pa_end; + unsigned long pa_end;
+ pa = list_entry(cur, struct ext3_prealloc_space, pa_inode_list); + pa = list_entry(cur, struct ext3_prealloc_space, pa_inode_list);
+ pa_end = pa->pa_lstart + pa->pa_len; + spin_lock(&pa->pa_lock);
+ BUG_ON(!(start >= pa_end || end <= pa->pa_lstart)); + if (pa->pa_deleted == 0) {
+ pa_end = pa->pa_lstart + pa->pa_len;
+ BUG_ON(!(start >= pa_end || end <= pa->pa_lstart));
+ }
+ spin_unlock(&pa->pa_lock);
+ } + }
+ rcu_read_unlock(); + rcu_read_unlock();
+ +
...@@ -3882,8 +3900,10 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c ...@@ -3882,8 +3900,10 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c
+ } + }
+ +
+ /* if we still need more blocks and some PAs were used, try again */ + /* if we still need more blocks and some PAs were used, try again */
+ if (free < needed && busy) + if (free < needed && busy) {
+ ext3_unlock_group(sb, group);
+ goto repeat; + goto repeat;
+ }
+ +
+ /* found anything to free? */ + /* found anything to free? */
+ if (list_empty(&list)) { + if (list_empty(&list)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment