]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: do not recurse into truncate|invalidate pages
authorSage Weil <sage@newdream.net>
Fri, 25 Sep 2009 22:58:16 +0000 (15:58 -0700)
committerSage Weil <sage@newdream.net>
Fri, 25 Sep 2009 22:58:16 +0000 (15:58 -0700)
A single open O_TRUNC on a file dirty pages would

-> truncate
-> put_wrbuffer_refs
-> check_caps
-> invalidate ... and deadlock

So, do not invalidate here if we have a pending truncate (which
remains elevated until after the truncate finishes).

src/kernel/caps.c

index 80772cfdb5dcdce4e99d66e552c75d1c51fa3ca8..723a6495b5d933111ee2acbf4c9330b98aed5ebb 100644 (file)
@@ -1348,6 +1348,7 @@ retry_locked:
            ci->i_wrbuffer_ref == 0 &&               /* no dirty pages... */
            ci->i_rdcache_gen &&                     /* may have cached pages */
            file_wanted == 0 &&                      /* no open files */
+           !ci->i_truncate_pending &&
            !tried_invalidate) {
                u32 invalidating_gen = ci->i_rdcache_gen;
                int ret;