[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>
This commit is contained in:
@@ -226,8 +226,11 @@ void gfs2_ail1_start_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
|
|||||||
gfs2_assert(sdp, bd->bd_ail == ai);
|
gfs2_assert(sdp, bd->bd_ail == ai);
|
||||||
|
|
||||||
if (!buffer_busy(bh)) {
|
if (!buffer_busy(bh)) {
|
||||||
if (!buffer_uptodate(bh))
|
if (!buffer_uptodate(bh)) {
|
||||||
|
gfs2_log_unlock(sdp);
|
||||||
gfs2_io_error_bh(sdp, bh);
|
gfs2_io_error_bh(sdp, bh);
|
||||||
|
gfs2_log_lock(sdp);
|
||||||
|
}
|
||||||
list_move(&bd->bd_ail_st_list,
|
list_move(&bd->bd_ail_st_list,
|
||||||
&ai->ai_ail2_list);
|
&ai->ai_ail2_list);
|
||||||
continue;
|
continue;
|
||||||
|
@@ -213,8 +213,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
|
|||||||
if (error)
|
if (error)
|
||||||
goto out_gunlock_q;
|
goto out_gunlock_q;
|
||||||
|
|
||||||
error = gfs2_trans_begin(sdp,
|
error = gfs2_trans_begin(sdp, sdp->sd_max_dirres +
|
||||||
sdp->sd_max_dirres +
|
|
||||||
al->al_rgd->rd_ri.ri_length +
|
al->al_rgd->rd_ri.ri_length +
|
||||||
2 * RES_DINODE + RES_STATFS +
|
2 * RES_DINODE + RES_STATFS +
|
||||||
RES_QUOTA, 0);
|
RES_QUOTA, 0);
|
||||||
|
@@ -155,11 +155,9 @@ int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh,
|
|||||||
if (!PageUptodate(page)) {
|
if (!PageUptodate(page)) {
|
||||||
void *kaddr = kmap(page);
|
void *kaddr = kmap(page);
|
||||||
|
|
||||||
memcpy(kaddr,
|
memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode),
|
||||||
dibh->b_data + sizeof(struct gfs2_dinode),
|
|
||||||
ip->i_di.di_size);
|
ip->i_di.di_size);
|
||||||
memset(kaddr + ip->i_di.di_size,
|
memset(kaddr + ip->i_di.di_size, 0,
|
||||||
0,
|
|
||||||
PAGE_CACHE_SIZE - ip->i_di.di_size);
|
PAGE_CACHE_SIZE - ip->i_di.di_size);
|
||||||
kunmap(page);
|
kunmap(page);
|
||||||
|
|
||||||
|
@@ -130,11 +130,12 @@ static void enforce_limit(struct gfs2_sbd *sdp)
|
|||||||
unsigned int tries = 0, min = 0;
|
unsigned int tries = 0, min = 0;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (atomic_read(&sdp->sd_unlinked_count) >=
|
if (atomic_read(&sdp->sd_unlinked_count) <
|
||||||
gfs2_tune_get(sdp, gt_ilimit)) {
|
gfs2_tune_get(sdp, gt_ilimit))
|
||||||
|
return;
|
||||||
|
|
||||||
tries = gfs2_tune_get(sdp, gt_ilimit_tries);
|
tries = gfs2_tune_get(sdp, gt_ilimit_tries);
|
||||||
min = gfs2_tune_get(sdp, gt_ilimit_min);
|
min = gfs2_tune_get(sdp, gt_ilimit_min);
|
||||||
}
|
|
||||||
|
|
||||||
while (tries--) {
|
while (tries--) {
|
||||||
struct gfs2_unlinked *ul = ul_fish(sdp);
|
struct gfs2_unlinked *ul = ul_fish(sdp);
|
||||||
|
Reference in New Issue
Block a user