From: phil Date: Thu, 25 Sep 2003 04:54:45 +0000 (+0000) Subject: re-committing on b_devel: X-Git-Tag: v1_7_0_51~2^7~498 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e26872131ae44b3758ade1ffdc41b97f6e5a1289;p=fs%2Flustre-release.git re-committing on b_devel: b=1997 r=alex My previous fix for truncate/write lock inversion was close, but badly flawed. I failed to remember that truncate will internally restart the transaction -- start a new one, for all intents and purposes -- so the ordering was backwards. "i_sem before transaction" is the cardinal rule. I tried to avoid that because I didn't want to hold the i_sem across the entire disk I/O in filter_commitrw_write. After some discussion with Alex, however, we decided that the i_sem need only be held for the block allocation, and that the BKL suffices for updating i_size. So the ordering in the write path is now: take i_sem, start transaction, call filter_direct_io, f_d_io does block alloc, drops i_sem, does I/O. --- diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index a8d77c5..43f16f4 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -374,7 +374,6 @@ void flip_into_page_cache(struct inode *inode, struct page *new_page) { struct page *old_page; int rc; - ENTRY; do { /* the dlm is protecting us from read/write concurrency, so we @@ -412,8 +411,6 @@ void flip_into_page_cache(struct inode *inode, struct page *new_page) rc = 0; #endif } while (rc != 0); - - EXIT; } /* XXX needs to trickle its oa down */