Skip to content

Commit a67d081

Browse files
committed
client: do not accept zero byte write request
Fixes: https://tracker.ceph.com/issues/63734 Signed-off-by: Dhairya Parmar <[email protected]>
1 parent b13fab2 commit a67d081

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/client/Client.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11441,6 +11441,10 @@ int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
1144111441
CWF_iofinish *cwf_iofinish = NULL;
1144211442
C_SaferCond *cond_iofinish = NULL;
1144311443

11444+
if (size < 1) { // zero bytes write is not supported by osd
11445+
return -CEPHFS_EINVAL;
11446+
}
11447+
1144411448
if ( (uint64_t)(offset+size) > mdsmap->get_max_filesize() && //exceeds config
1144511449
(uint64_t)(offset+size) > in->size ) { //exceeds filesize
1144611450
return -CEPHFS_EFBIG;

0 commit comments

Comments
 (0)