aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-05-18 14:10:52 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-05-18 14:10:52 -0400
commit1b50259bc33f2adfcb4c5fba4b740bf80789df22 (patch)
treef8d20f032c9cb85883cdee846423667543947dde /fs/gfs2
parent02f211f4d0e67794020ba1babbdaf7c45d56db45 (diff)
[GFS2] Drop log lock on I/O error & tidy up
This patch drops the log spinlock when an I/O error occurs to avoid any possible problems in case of blocking or recursion in the I/O error routine. It also has a few cosmetic changes to tidy up various other files. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/meta_io.c5
-rw-r--r--fs/gfs2/ops_inode.c5
-rw-r--r--fs/gfs2/page.c6
-rw-r--r--fs/gfs2/unlinked.c17
4 files changed, 17 insertions, 16 deletions
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index da49973a90d1..fe46d563d3c8 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -226,8 +226,11 @@ void gfs2_ail1_start_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
226 gfs2_assert(sdp, bd->bd_ail == ai); 226 gfs2_assert(sdp, bd->bd_ail == ai);
227 227
228 if (!buffer_busy(bh)) { 228 if (!buffer_busy(bh)) {
229 if (!buffer_uptodate(bh)) 229 if (!buffer_uptodate(bh)) {
230 gfs2_log_unlock(sdp);
230 gfs2_io_error_bh(sdp, bh); 231 gfs2_io_error_bh(sdp, bh);
232 gfs2_log_lock(sdp);
233 }
231 list_move(&bd->bd_ail_st_list, 234 list_move(&bd->bd_ail_st_list,
232 &ai->ai_ail2_list); 235 &ai->ai_ail2_list);
233 continue; 236 continue;
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 62a12a59d91b..b25ec4c8e56a 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -213,8 +213,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
213 if (error) 213 if (error)
214 goto out_gunlock_q; 214 goto out_gunlock_q;
215 215
216 error = gfs2_trans_begin(sdp, 216 error = gfs2_trans_begin(sdp, sdp->sd_max_dirres +
217 sdp->sd_max_dirres +
218 al->al_rgd->rd_ri.ri_length + 217 al->al_rgd->rd_ri.ri_length +
219 2 * RES_DINODE + RES_STATFS + 218 2 * RES_DINODE + RES_STATFS +
220 RES_QUOTA, 0); 219 RES_QUOTA, 0);
@@ -303,7 +302,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
303 if (error) 302 if (error)
304 goto out_gunlock; 303 goto out_gunlock;
305 304
306 error = gfs2_unlinki(dip, &dentry->d_name, ip,ul); 305 error = gfs2_unlinki(dip, &dentry->d_name, ip, ul);
307 306
308 gfs2_trans_end(sdp); 307 gfs2_trans_end(sdp);
309 308
diff --git a/fs/gfs2/page.c b/fs/gfs2/page.c
index a2c9e93c7c39..495db5594164 100644
--- a/fs/gfs2/page.c
+++ b/fs/gfs2/page.c
@@ -155,11 +155,9 @@ int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh,
155 if (!PageUptodate(page)) { 155 if (!PageUptodate(page)) {
156 void *kaddr = kmap(page); 156 void *kaddr = kmap(page);
157 157
158 memcpy(kaddr, 158 memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode),
159 dibh->b_data + sizeof(struct gfs2_dinode),
160 ip->i_di.di_size); 159 ip->i_di.di_size);
161 memset(kaddr + ip->i_di.di_size, 160 memset(kaddr + ip->i_di.di_size, 0,
162 0,
163 PAGE_CACHE_SIZE - ip->i_di.di_size); 161 PAGE_CACHE_SIZE - ip->i_di.di_size);
164 kunmap(page); 162 kunmap(page);
165 163
diff --git a/fs/gfs2/unlinked.c b/fs/gfs2/unlinked.c
index 0d2314a5252c..2824b1665f95 100644
--- a/fs/gfs2/unlinked.c
+++ b/fs/gfs2/unlinked.c
@@ -130,11 +130,12 @@ static void enforce_limit(struct gfs2_sbd *sdp)
130 unsigned int tries = 0, min = 0; 130 unsigned int tries = 0, min = 0;
131 int error; 131 int error;
132 132
133 if (atomic_read(&sdp->sd_unlinked_count) >= 133 if (atomic_read(&sdp->sd_unlinked_count) <
134 gfs2_tune_get(sdp, gt_ilimit)) { 134 gfs2_tune_get(sdp, gt_ilimit))
135 tries = gfs2_tune_get(sdp, gt_ilimit_tries); 135 return;
136 min = gfs2_tune_get(sdp, gt_ilimit_min); 136
137 } 137 tries = gfs2_tune_get(sdp, gt_ilimit_tries);
138 min = gfs2_tune_get(sdp, gt_ilimit_min);
138 139
139 while (tries--) { 140 while (tries--) {
140 struct gfs2_unlinked *ul = ul_fish(sdp); 141 struct gfs2_unlinked *ul = ul_fish(sdp);
@@ -187,7 +188,7 @@ int gfs2_unlinked_get(struct gfs2_sbd *sdp, struct gfs2_unlinked **ul)
187 188
188 goto fail; 189 goto fail;
189 190
190 found: 191found:
191 for (b = 0; b < 8; b++) 192 for (b = 0; b < 8; b++)
192 if (!(byte & (1 << b))) 193 if (!(byte & (1 << b)))
193 break; 194 break;
@@ -202,7 +203,7 @@ int gfs2_unlinked_get(struct gfs2_sbd *sdp, struct gfs2_unlinked **ul)
202 203
203 return 0; 204 return 0;
204 205
205 fail: 206fail:
206 spin_unlock(&sdp->sd_unlinked_spin); 207 spin_unlock(&sdp->sd_unlinked_spin);
207 kfree(*ul); 208 kfree(*ul);
208 return -ENOSPC; 209 return -ENOSPC;
@@ -410,7 +411,7 @@ int gfs2_unlinked_init(struct gfs2_sbd *sdp)
410 411
411 return 0; 412 return 0;
412 413
413 fail: 414fail:
414 gfs2_unlinked_cleanup(sdp); 415 gfs2_unlinked_cleanup(sdp);
415 return error; 416 return error;
416} 417}