diff --git a/src/kernel/inode.c b/src/kernel/inode.c index 95abfb18fd5..a1eb98fa959 100644 --- a/src/kernel/inode.c +++ b/src/kernel/inode.c @@ -834,7 +834,7 @@ retry: ceph_mdsc_send_cap_ack(mdsc, ceph_ino(&ci->vfs_inode), keep, wanted, seq, - size, max_size, &mtime, &atime, mds); + size, 0, &mtime, &atime, mds); if (dropping & CEPH_CAP_RDCACHE) { dout(20, "invalidating pages on %p\n", &ci->vfs_inode); @@ -999,6 +999,7 @@ int ceph_handle_cap_grant(struct inode *inode, struct ceph_mds_file_caps *grant, cap->implemented = newcaps; /* ack now. re-use incoming message. */ grant->size = le64_to_cpu(inode->i_size); + grant->max_size = 0; /* don't re-request */ ceph_encode_timespec(&grant->mtime, &inode->i_mtime); ceph_encode_timespec(&grant->atime, &inode->i_atime); reply = 1; @@ -1094,8 +1095,13 @@ int ceph_get_cap_refs(struct ceph_inode_info *ci, int need, int want, int *got, need, want); spin_lock(&ci->vfs_inode.i_lock); if (offset >= 0 && offset >= (loff_t)ci->i_max_size) { - dout(20, "get_cap_refs offset %llu >= max_size %llu\n", - offset, ci->i_max_size); + if (offset > (ci->vfs_inode.i_size << 1)) { + dout(20, "get_cap_refs offset %llu >= max_size %llu\n", + offset, ci->i_max_size); + + } else + dout(20, "get_cap_refs offset %llu >= max_size %llu\n", + offset, ci->i_max_size); goto sorry; } have = __ceph_caps_issued(ci); diff --git a/src/kernel/mds_client.c b/src/kernel/mds_client.c index 22e3f461ef5..c34b7afe637 100644 --- a/src/kernel/mds_client.c +++ b/src/kernel/mds_client.c @@ -1327,7 +1327,7 @@ void ceph_mdsc_handle_filecaps(struct ceph_mds_client *mdsc, dout(10, "wtf, i don't have ino %lu=%llx? closing out cap\n", inot, ino); ceph_mdsc_send_cap_ack(mdsc, ino, 0, 0, seq, - size, max_size, 0, 0, mds); + size, 0, 0, 0, mds); return; } diff --git a/src/kernel/super.h b/src/kernel/super.h index e664b8ae1c4..622cae935b8 100644 --- a/src/kernel/super.h +++ b/src/kernel/super.h @@ -157,7 +157,7 @@ struct ceph_inode_info { int i_nr_by_mode[4]; loff_t i_max_size; /* size authorized by mds */ - loff_t i_reported_size; /* size we're reported to mds(s) */ + loff_t i_reported_size; /* (max_)size reported to or requested of mds */ struct timespec i_old_atime; /* held references to caps */ diff --git a/src/start.sh b/src/start.sh index 224ef50c9be..3626175f0ca 100755 --- a/src/start.sh +++ b/src/start.sh @@ -43,7 +43,7 @@ do done # mds -$CEPH_BIN/cmds $ARGS --debug_mds 20 --debug_timer 50 --debug_ms 20 --debug 50 +$CEPH_BIN/cmds $ARGS --debug_mds 20 --debug_ms 1 echo "started. stop.sh to stop. see out/* (e.g. 'tail -f out/????') for debug output."