From: adilger Date: Fri, 15 Aug 2003 20:28:09 +0000 (+0000) Subject: Fix for truncate/write inversion. X-Git-Tag: v1_7_100~3355 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=19b55ff0decd600807e02f318e3dee0a965e4a47;p=fs%2Flustre-release.git Fix for truncate/write inversion. b=1639 r=phil --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index e64c5da..791dfbc 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -670,8 +670,12 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) * nodes through dirtying and writeback of final cached * pages. This last one is especially bad for racing * o_append users on other nodes. */ + /* bug 1639: avoid write/truncate i_sem/DLM deadlock */ + LASSERT(atomic_read(&inode->i_sem.count) == 0); + up(&inode->i_sem); rc = ll_extent_lock_no_validate(NULL, inode, lsm, LCK_PW, &extent, &lockh); + down(&inode->i_sem); if (rc != ELDLM_OK) { if (rc > 0) RETURN(-ENOLCK);