[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aK9_u9ZK9NgKiBkE@kbusch-mbp>
Date: Wed, 27 Aug 2025 15:59:23 -0600
From: Keith Busch <kbusch@...nel.org>
To: Jens Axboe <axboe@...nel.dk>
Cc: Qingyue Zhang <chunzhennn@...com>, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org, Suoxing Zhang <aftern00n@...com>
Subject: Re: [PATCH 2/2] io_uring/kbuf: fix infinite loop in
io_kbuf_inc_commit()
On Wed, Aug 27, 2025 at 03:45:28PM -0600, Jens Axboe wrote:
> > + buf_len = READ_ONCE(buf->len);
> > + this_len = min_t(int, len, buf_len);
> > + buf_len -= this_len;
> > + if (buf_len) {
> > buf->addr += this_len;
> > + buf->len = buf_len;
> > return false;
> > }
> > + buf->len = 0;
Purely for symmetry, assigning buf->len ought to be a WRITE_ONCE.
Powered by blists - more mailing lists