Whamcloud - gitweb
Don't leave stale dentries around after renames (from 1.0.4).
authoradilger <adilger>
Tue, 10 Feb 2004 00:02:17 +0000 (00:02 +0000)
committeradilger <adilger>
Tue, 10 Feb 2004 00:02:17 +0000 (00:02 +0000)
b=2428

lustre/ChangeLog
lustre/llite/namei.c
lustre/tests/sanity.sh

index 562d249..7fb431f 100644 (file)
@@ -22,6 +22,7 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - 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. <info@clusterfs.com>
        * version 1.0.3
index da53dcb..7056f65 100644 (file)
@@ -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) {
index 584a57a..5337a42 100644 (file)
@@ -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() {