]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: reset i_requested_max_size if file write is not wanted
authorYan, Zheng <zyan@redhat.com>
Mon, 30 Mar 2020 11:56:37 +0000 (19:56 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 1 Jun 2020 11:22:52 +0000 (13:22 +0200)
commit803dfa61d7cc54e520d78c254b46ba95bf2d7c93
tree41e1ba6c5d974c2a58d5019df99996063ae060d4
parent2885def3b1a35b7dc97a57dd4a1fd571a6c1f8ac
ceph: reset i_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'.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c