1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-25 22:48:36 +00:00

Add error logs when fs backend read or write blocks.

This commit is contained in:
ly1217
2019-10-04 04:00:49 -07:00
parent 9c1cc32781
commit fc4ab83f7f

View File

@@ -97,7 +97,14 @@ block_backend_fs_read_block (BlockBackend *bend,
BHandle *handle,
void *buf, int len)
{
return (readn (handle->fd, buf, len));
int ret;
ret = readn (handle->fd, buf, len);
if (ret < 0)
seaf_warning ("Failed to read block %s:%s: %s.\n",
handle->store_id, handle->block_id, strerror (errno));
return ret;
}
static int
@@ -105,7 +112,14 @@ block_backend_fs_write_block (BlockBackend *bend,
BHandle *handle,
const void *buf, int len)
{
return (writen (handle->fd, buf, len));
int ret;
ret = writen (handle->fd, buf, len);
if (ret < 0)
seaf_warning ("Failed to write block %s:%s: %s.\n",
handle->store_id, handle->block_id, strerror (errno));
return ret;
}
static int