From: zab Date: Fri, 5 Dec 2003 20:28:01 +0000 (+0000) Subject: b=2330 X-Git-Tag: 1.0.2~92 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=092bc367739b954a056d95290b265e94264c899f;p=fs%2Flustre-release.git b=2330 minor state cleanup from matching error return paths --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 06467e3..bd573aa 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -490,10 +490,8 @@ int ll_extent_lock(struct ll_file_data *fd, struct inode *inode, RETURN(0); rc = ll_lsm_getattr(exp, lsm, &oa); - if (rc) { - ll_extent_unlock(fd, inode, lsm, mode, lockh); - RETURN(rc); - } + if (rc) + GOTO(out, rc); /* We set this flag in commit write as we extend the file size. When * the bit is set and the lock is canceled that covers the file size, @@ -528,7 +526,7 @@ int ll_extent_lock(struct ll_file_data *fd, struct inode *inode, sizeof(size_lock), LCK_PR, &flags, inode, &match_lockh); if (matched < 0) - RETURN(matched); + GOTO(out, rc = matched); /* hey, alright, we hold a size lock that covers the size we * just found, its not going to change for a while.. */ @@ -537,7 +535,11 @@ int ll_extent_lock(struct ll_file_data *fd, struct inode *inode, obd_cancel(exp, lsm, LCK_PR, &match_lockh); } - RETURN(0); + rc = 0; +out: + if (rc) + ll_extent_unlock(fd, inode, lsm, mode, lockh); + RETURN(rc); } int ll_extent_unlock(struct ll_file_data *fd, struct inode *inode, diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 6970683..b8ff805 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -559,6 +559,8 @@ static void ll_start_readahead(struct obd_export *exp, struct inode *inode, &flags, inode, &match_lockh); if (matched < 0) { LL_CDEBUG_PAGE(page, "lock match failed\n"); + unlock_page(page); + page_cache_release(page); break; } if (matched == 0) {