]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
client: reset requested_max_size if file write is not wanted 34274/head
authorYan, Zheng <zyan@redhat.com>
Fri, 20 Mar 2020 05:15:45 +0000 (13:15 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 16 Apr 2020 03:22:27 +0000 (11:22 +0800)
commit1d676851e3491c26d3bf543bf357731d11d82a85
tree94a1859e7f2027fc7ae4c362135035bf99acc857
parent20efbfb5077bb0633fd6ceab4bf50876e29744aa
client: reset requested_max_size if file write is not wanted

write can stuck at waiting for larger max_size in following sequence of
events:

- client opens a file and writes to position 'A' (larger than unit of
  max size increment)
- client closes the file handle and updates wanted caps (not wanting
  file write caps)
- client opens and truncates the file, writes to position 'A' again.

At the 1st event, client set inode's requested_max_size to 'A'. At the
2nd event, mds removes client's writable range, but client does not reset
requested_max_size. At the 3rd event, client does not request max size
because requested_max_size is already larger than 'A'.

Fixes: https://tracker.ceph.com/issues/44801
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/client/Client.cc