mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 03:00:44 +00:00
scoutfs: return -ENOSPC to client alloc segno
The server send_reply interface is confusing. It uses errors to shut down the connection. Clients getting enospc needs to happen in the message reply payload. The segno allocation server processing needs to set the segno to 0 so that the client gets it and translates that into -ENOSPC. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -753,7 +753,7 @@ static int process_alloc_segno(struct server_connection *conn,
|
||||
struct server_info *server = conn->server;
|
||||
struct super_block *sb = server->sb;
|
||||
struct commit_waiter cw;
|
||||
__le64 lesegno;
|
||||
__le64 lesegno = 0;
|
||||
u64 segno;
|
||||
int ret;
|
||||
|
||||
@@ -767,10 +767,12 @@ static int process_alloc_segno(struct server_connection *conn,
|
||||
if (ret == 0) {
|
||||
lesegno = cpu_to_le64(segno);
|
||||
queue_commit_work(server, &cw);
|
||||
} else if (ret == -ENOSPC) {
|
||||
ret = 0;
|
||||
}
|
||||
up_read(&server->commit_rwsem);
|
||||
|
||||
if (ret == 0)
|
||||
if (ret == 0 && lesegno != 0)
|
||||
ret = wait_for_commit(server, &cw, id, type);
|
||||
out:
|
||||
return send_reply(conn, id, type, ret, &lesegno, sizeof(lesegno));
|
||||
|
||||
Reference in New Issue
Block a user