mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-25 06:25:13 +00:00
Merge pull request #270 from haiwen/log_failed
Add error logs when fs backend read or write blocks.
This commit is contained in:
@@ -97,7 +97,14 @@ block_backend_fs_read_block (BlockBackend *bend,
|
|||||||
BHandle *handle,
|
BHandle *handle,
|
||||||
void *buf, int len)
|
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
|
static int
|
||||||
@@ -105,7 +112,14 @@ block_backend_fs_write_block (BlockBackend *bend,
|
|||||||
BHandle *handle,
|
BHandle *handle,
|
||||||
const void *buf, int len)
|
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
|
static int
|
||||||
|
Reference in New Issue
Block a user