ceph: only let auth caps update max_size

Only the auth MDS has a meaningful max_size value for us, so only update it
in fill_inode if we're being issued an auth cap. Otherwise, a random
stat result from a non-auth MDS can clobber a meaningful max_size, get
the client<->mds cap state out of sync, and make writes hang.

Specifically, even if the client re-requests a larger max_size (which it
will), the MDS won't respond because as far as it knows we already have a
sufficiently large value.

Signed-off-by: Sage Weil <sage@newdream.net>

Sage Weil 912a9b03 7421ab80

+8 -1
+8 -1
fs/ceph/inode.c
··· 606 606 le32_to_cpu(info->time_warp_seq), 607 607 &ctime, &mtime, &atime); 608 608 609 - ci->i_max_size = le64_to_cpu(info->max_size); 609 + /* only update max_size on auth cap */ 610 + if ((info->cap.flags & CEPH_CAP_FLAG_AUTH) && 611 + ci->i_max_size != le64_to_cpu(info->max_size)) { 612 + dout("max_size %lld -> %llu\n", ci->i_max_size, 613 + le64_to_cpu(info->max_size)); 614 + ci->i_max_size = le64_to_cpu(info->max_size); 615 + } 616 + 610 617 ci->i_layout = info->layout; 611 618 inode->i_blkbits = fls(le32_to_cpu(info->layout.fl_stripe_unit)) - 1; 612 619