]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/filestore: fix result code overwritten for clone
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 19 Feb 2016 09:56:28 +0000 (17:56 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 19 Feb 2016 10:10:22 +0000 (18:10 +0800)
commit877eae85ce7630fa05cc16f5f71be40e08607a5c
treee992b69bce2486faeec8c34c073957ebf02a1dd2
parentb556b24a31bdfdd05deb9d201949fd78fad4a71c
os/filestore: fix result code overwritten for clone

During the clone process, the result code of syscall-fstat which is intend for
getting the source size for copying is not checked and will be overwritten
by the following call, which is of potential risk and thus should be considered
as unsafe.

This pr solves the above problem by adding result checking against failure.
Also result code is reset to errno for better tracing if the ftruncate syscall
failed.

Fixes: #14817
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/filestore/FileStore.cc