From: adilger Date: Tue, 10 Feb 2004 00:02:17 +0000 (+0000) Subject: Don't leave stale dentries around after renames (from 1.0.4). X-Git-Tag: v1_7_100~2626 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0ac83dc97cdd7ec37476d06bcb3eec443a910ed5;hp=6ff516b78401cc04a61634040c0a99f25fc93d09;p=fs%2Flustre-release.git Don't leave stale dentries around after renames (from 1.0.4). b=2428 --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 562d249..7fb431f 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -22,6 +22,7 @@ tbd Cluster File Systems, Inc. - ensure len(uuid) < 37 in lmc (1171) - fix ia64 OOPS in llog_test (2255) - zero end of page at obdfilter for partial page writes (2648) + - don't leave stale dentries around after renames (bug 2428) 2004-01-27 Cluster File Systems, Inc. * version 1.0.3 diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index da53dcb..7056f65 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -279,6 +279,10 @@ static int lookup_it_finish(struct ptlrpc_request *request, int offset, if (rc) RETURN(rc); + CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u)\n", + inode, inode->i_ino, inode->i_generation); + mdc_set_lock_data(&it->d.lustre.it_lock_handle, inode); + /* If this is a stat, get the authoritative file size */ if (it->it_op == IT_GETATTR && S_ISREG(inode->i_mode) && ll_i2info(inode)->lli_smd != NULL) { diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 584a57a..5337a42 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -628,6 +628,17 @@ test_24m() { } run_test 24m "Renaming a file to a hard link to itself =========" +test_24n() { + f="$DIR/f24n" + # this stats the old file after it was renamed, so it should fail + touch ${f} + $CHECKSTAT ${f} + mv ${f} ${f}.rename + $CHECKSTAT ${f}.rename + $CHECKSTAT -a ${f} +} +run_test 24n "Statting the old file after renameing (Posix rename 2)" + test_25a() { echo '== symlink sanity =============================================' mkdir $DIR/d25 @@ -1634,7 +1645,7 @@ test_61() { multiop $f OSMWUc || error sync } -run_test 61 "mmap() writes don't make sync hang ==========" +run_test 61 "mmap() writes don't make sync hang ================" # bug 2330 - insufficient obd_match error checking causes LBUG test_62() {