Magma's filesystem wrapper has a bug where if a pwrite is retried due to a partial write or EINTR or EAGAIN, we use the original length ie. the length of the partial write is not decremented correctly. This can result in segfaults(since we are writing a length greater than buffer length) or WAL corruption since the WAL tried repair of blocks.
This is the incorrect lines of code, we should be using nwrite instead of len.
This was noticed while reviewing code for
MB-56097 and is a must fix.
|For Gerrit Dashboard: MB-56271|
|189118,3||MB-56271 magma: Fix incorrect length during pwrite retry||neo||magma||Status: MERGED||+2||+1|