scoutfs: fix error unwinding in server advance_seq

While checking for lost server commit holds, I noticed that the
advance_seq request path had obviously incorrect unwinding after getting
an error.  Fix it up so that it always unlocks and applies its commit.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-07-16 11:07:14 -07:00
committed by Zach Brown
parent 4b9c02ba32
commit f4db553c28

View File

@@ -747,7 +747,7 @@ static int server_advance_seq(struct super_block *sb,
ret = scoutfs_btree_delete(sb, &server->alloc, &server->wri,
&super->trans_seqs, &key);
if (ret < 0 && ret != -ENOENT)
goto out;
goto unlock;
}
next_seq = super->next_trans_seq;
@@ -759,10 +759,11 @@ static int server_advance_seq(struct super_block *sb,
init_trans_seq_key(&key, le64_to_cpu(next_seq), rid);
ret = scoutfs_btree_insert(sb, &server->alloc, &server->wri,
&super->trans_seqs, &key, NULL, 0);
out:
unlock:
up_write(&server->seq_rwsem);
ret = scoutfs_server_apply_commit(sb, ret);
out:
return scoutfs_net_response(sb, conn, cmd, id, ret,
&next_seq, sizeof(next_seq));
}