ceph: Move the place for EOLDSNAPC handle in ceph_aio_write to easily understand
Only for ceph_sync_write, the osd can return EOLDSNAPC.so move the related codes after the call ceph_sync_write. Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
a158073c43
commit
0e5dd45ce4
1 changed files with 9 additions and 7 deletions
|
@ -766,6 +766,15 @@ retry_snap:
|
||||||
mutex_unlock(&inode->i_mutex);
|
mutex_unlock(&inode->i_mutex);
|
||||||
written = ceph_sync_write(file, iov->iov_base, count,
|
written = ceph_sync_write(file, iov->iov_base, count,
|
||||||
pos, &iocb->ki_pos);
|
pos, &iocb->ki_pos);
|
||||||
|
if (written == -EOLDSNAPC) {
|
||||||
|
dout("aio_write %p %llx.%llx %llu~%u"
|
||||||
|
"got EOLDSNAPC, retrying\n",
|
||||||
|
inode, ceph_vinop(inode),
|
||||||
|
pos, (unsigned)iov->iov_len);
|
||||||
|
mutex_lock(&inode->i_mutex);
|
||||||
|
hold_mutex = true;
|
||||||
|
goto retry_snap;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
written = generic_file_buffered_write(iocb, iov, nr_segs,
|
written = generic_file_buffered_write(iocb, iov, nr_segs,
|
||||||
pos, &iocb->ki_pos,
|
pos, &iocb->ki_pos,
|
||||||
|
@ -796,13 +805,6 @@ retry_snap:
|
||||||
written = err;
|
written = err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (written == -EOLDSNAPC) {
|
|
||||||
dout("aio_write %p %llx.%llx %llu~%u got EOLDSNAPC, retrying\n",
|
|
||||||
inode, ceph_vinop(inode), pos, (unsigned)iov->iov_len);
|
|
||||||
mutex_lock(&inode->i_mutex);
|
|
||||||
hold_mutex = true;
|
|
||||||
goto retry_snap;
|
|
||||||
}
|
|
||||||
out:
|
out:
|
||||||
if (hold_mutex)
|
if (hold_mutex)
|
||||||
mutex_unlock(&inode->i_mutex);
|
mutex_unlock(&inode->i_mutex);
|
||||||
|
|
Loading…
Reference in a new issue