mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-25 14:42:52 +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,
|
||||
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
|
||||
|
Reference in New Issue
Block a user