diff options
| author | Boaz Harrosh <bharrosh@panasas.com> | 2012-07-11 08:27:13 -0400 |
|---|---|---|
| committer | Boaz Harrosh <bharrosh@panasas.com> | 2012-07-20 04:49:25 -0400 |
| commit | 537632e0a54a5355cdd0330911d18c3b773f9cf7 (patch) | |
| tree | 7b4440d84c4dffa50c81a0c8bbb86f8da93748ca | |
| parent | 62b62ad873f2accad9222a4d7ffbe1e93f6714c1 (diff) | |
ore: Unlock r4w pages in exact reverse order of locking
The read-4-write pages are locked in address ascending order.
But where unlocked in a way easiest for coding. Fix that,
locks should be released in opposite order of locking, .i.e
descending address order.
I have not hit this dead-lock. It was found by inspecting the
dbug print-outs. I suspect there is an higher lock at caller that
protects us, but fix it regardless.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
| -rw-r--r-- | fs/exofs/ore_raid.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c index fff2070c6751..5f376d14fdcc 100644 --- a/fs/exofs/ore_raid.c +++ b/fs/exofs/ore_raid.c | |||
| @@ -144,26 +144,26 @@ static void _sp2d_reset(struct __stripe_pages_2d *sp2d, | |||
| 144 | { | 144 | { |
| 145 | unsigned data_devs = sp2d->data_devs; | 145 | unsigned data_devs = sp2d->data_devs; |
| 146 | unsigned group_width = data_devs + sp2d->parity; | 146 | unsigned group_width = data_devs + sp2d->parity; |
| 147 | unsigned p; | 147 | int p, c; |
| 148 | 148 | ||
| 149 | if (!sp2d->needed) | 149 | if (!sp2d->needed) |
| 150 | return; | 150 | return; |
| 151 | 151 | ||
| 152 | for (p = 0; p < sp2d->pages_in_unit; p++) { | 152 | for (c = data_devs - 1; c >= 0; --c) |
| 153 | struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; | 153 | for (p = sp2d->pages_in_unit - 1; p >= 0; --p) { |
| 154 | 154 | struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; | |
| 155 | if (_1ps->write_count < group_width) { | ||
| 156 | unsigned c; | ||
| 157 | 155 | ||
| 158 | for (c = 0; c < data_devs; c++) | 156 | if (_1ps->page_is_read[c]) { |
| 159 | if (_1ps->page_is_read[c]) { | 157 | struct page *page = _1ps->pages[c]; |
| 160 | struct page *page = _1ps->pages[c]; | ||
| 161 | 158 | ||
| 162 | r4w->put_page(priv, page); | 159 | r4w->put_page(priv, page); |
| 163 | _1ps->page_is_read[c] = false; | 160 | _1ps->page_is_read[c] = false; |
| 164 | } | 161 | } |
| 165 | } | 162 | } |
| 166 | 163 | ||
| 164 | for (p = 0; p < sp2d->pages_in_unit; p++) { | ||
| 165 | struct __1_page_stripe *_1ps = &sp2d->_1p_stripes[p]; | ||
| 166 | |||
| 167 | memset(_1ps->pages, 0, group_width * sizeof(*_1ps->pages)); | 167 | memset(_1ps->pages, 0, group_width * sizeof(*_1ps->pages)); |
| 168 | _1ps->write_count = 0; | 168 | _1ps->write_count = 0; |
| 169 | _1ps->tx = NULL; | 169 | _1ps->tx = NULL; |
