Fix give not to wipe out concurrect updates

give() reads the sector, prompts for input, updates the sector and
writes it back, triggering a generation oops.  Any updates made by
other threads during the yield are wiped out, triggering a seqno
mismatch oops.
This commit is contained in:
Markus Armbruster 2011-04-11 21:52:10 +02:00
parent e3cf1e3280
commit b58c37e296

View file

@ -62,6 +62,7 @@ give(void)
return RET_SYN; return RET_SYN;
if ((amt = atoi(p)) == 0) if ((amt = atoi(p)) == 0)
return RET_SYN; return RET_SYN;
check_sect_ok(&sect);
n = sect.sct_item[ip->i_uid]; n = sect.sct_item[ip->i_uid];
if (amt < 0 && -amt > n) { if (amt < 0 && -amt > n) {
m = 0; m = 0;