Return FILE_SYNC from NFS writes if immediate_commit is enabled
parent
f153bc950b
commit
ab0ca7c00f
|
@ -392,7 +392,6 @@ static int nfs3_write_proc(void *opaque, rpc_op_t *rop)
|
||||||
.resok = (WRITE3resok){
|
.resok = (WRITE3resok){
|
||||||
//.file_wcc = ...,
|
//.file_wcc = ...,
|
||||||
.count = (unsigned)count,
|
.count = (unsigned)count,
|
||||||
.committed = args->stable,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if ((args->offset % alignment) != 0 || (count % alignment) != 0)
|
if ((args->offset % alignment) != 0 || (count % alignment) != 0)
|
||||||
|
@ -493,10 +492,11 @@ static void nfs_do_write(nfs_client_t *self, rpc_op_t *rop, uint64_t inode, uint
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
bool imm = self->parent->cli->get_immediate_commit(inode);
|
||||||
|
reply->resok.committed = args->stable != UNSTABLE || imm ? FILE_SYNC : UNSTABLE;
|
||||||
*(uint64_t*)reply->resok.verf = self->parent->server_id;
|
*(uint64_t*)reply->resok.verf = self->parent->server_id;
|
||||||
delete op;
|
delete op;
|
||||||
if (args->stable != UNSTABLE &&
|
if (args->stable != UNSTABLE && !imm)
|
||||||
!self->parent->cli->get_immediate_commit(inode))
|
|
||||||
{
|
{
|
||||||
// Client requested a stable write. Add an fsync
|
// Client requested a stable write. Add an fsync
|
||||||
op = new cluster_op_t;
|
op = new cluster_op_t;
|
||||||
|
|
Loading…
Reference in New Issue