summaryrefslogtreecommitdiffstats
path: root/fs
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
parent02f211f4d0e67794020ba1babbdaf7c45d56db45 (diff)
downloadop-kernel-dev-1b50259bc33f2adfcb4c5fba4b740bf80789df22.zip
op-kernel-dev-1b50259bc33f2adfcb4c5fba4b740bf80789df22.tar.gz
[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')
-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 da49973..fe46d563 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)
gfs2_assert(sdp, bd->bd_ail == ai);
if (!buffer_busy(bh)) {
- if (!buffer_uptodate(bh))
+ if (!buffer_uptodate(bh)) {
+ gfs2_log_unlock(sdp);
gfs2_io_error_bh(sdp, bh);
+ gfs2_log_lock(sdp);
+ }
list_move(&bd->bd_ail_st_list,
&ai->ai_ail2_list);
continue;
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 62a12a5..b25ec4c 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,
if (error)
goto out_gunlock_q;
- error = gfs2_trans_begin(sdp,
- sdp->sd_max_dirres +
+ error = gfs2_trans_begin(sdp, sdp->sd_max_dirres +
al->al_rgd->rd_ri.ri_length +
2 * RES_DINODE + RES_STATFS +
RES_QUOTA, 0);
@@ -303,7 +302,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
if (error)
goto out_gunlock;
- error = gfs2_unlinki(dip, &dentry->d_name, ip,ul);
+ error = gfs2_unlinki(dip, &dentry->d_name, ip, ul);
gfs2_trans_end(sdp);
diff --git a/fs/gfs2/page.c b/fs/gfs2/page.c
index a2c9e93..495db55 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,
if (!PageUptodate(page)) {
void *kaddr = kmap(page);
- memcpy(kaddr,
- dibh->b_data + sizeof(struct gfs2_dinode),
+ memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode),
ip->i_di.di_size);
- memset(kaddr + ip->i_di.di_size,
- 0,
+ memset(kaddr + ip->i_di.di_size, 0,
PAGE_CACHE_SIZE - ip->i_di.di_size);
kunmap(page);
diff --git a/fs/gfs2/unlinked.c b/fs/gfs2/unlinked.c
index 0d2314a..2824b16 100644
--- a/fs/gfs2/unlinked.c
+++ b/fs/gfs2/unlinked.c
@@ -130,11 +130,12 @@ static void enforce_limit(struct gfs2_sbd *sdp)
unsigned int tries = 0, min = 0;
int error;
- if (atomic_read(&sdp->sd_unlinked_count) >=
- gfs2_tune_get(sdp, gt_ilimit)) {
- tries = gfs2_tune_get(sdp, gt_ilimit_tries);
- min = gfs2_tune_get(sdp, gt_ilimit_min);
- }
+ if (atomic_read(&sdp->sd_unlinked_count) <
+ gfs2_tune_get(sdp, gt_ilimit))
+ return;
+
+ tries = gfs2_tune_get(sdp, gt_ilimit_tries);
+ min = gfs2_tune_get(sdp, gt_ilimit_min);
while (tries--) {
struct gfs2_unlinked *ul = ul_fish(sdp);
@@ -187,7 +188,7 @@ int gfs2_unlinked_get(struct gfs2_sbd *sdp, struct gfs2_unlinked **ul)
goto fail;
- found:
+found:
for (b = 0; b < 8; b++)
if (!(byte & (1 << b)))
break;
@@ -202,7 +203,7 @@ int gfs2_unlinked_get(struct gfs2_sbd *sdp, struct gfs2_unlinked **ul)
return 0;
- fail:
+fail:
spin_unlock(&sdp->sd_unlinked_spin);
kfree(*ul);
return -ENOSPC;
@@ -410,7 +411,7 @@ int gfs2_unlinked_init(struct gfs2_sbd *sdp)
return 0;
- fail:
+fail:
gfs2_unlinked_cleanup(sdp);
return error;
}
OpenPOWER on IntegriCloud