[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200508033625.GO16070@bombadil.infradead.org>
Date: Thu, 7 May 2020 20:36:25 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Vasily Averin <vvs@...tuozzo.com>, linux-kernel@...r.kernel.org,
Waiman Long <longman@...hat.com>,
Andreas Schwab <schwab@...e.de>
Subject: Re: [PATCH] ipc/util.c: sysvipc_find_ipc() incorrectly updates
position index
On Thu, May 07, 2020 at 05:02:42PM -0700, Andrew Morton wrote:
> Here's how I resolved things. Please check?
>
> static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
> loff_t *new_pos)
> {
> unsigned long index = pos;
> struct kern_ipc_perm *ipc;
>
> rcu_read_lock();
> ipc = xa_find(&ids->ipcs, &index, ULONG_MAX, XA_PRESENT);
> if (ipc)
> ipc_lock_object(ipc);
> else
> rcu_read_unlock();
> *new_pos = pos + 1;
> return ipc;
> }
Surely that should be '*new_pos = index + 1'? Or did I misunderstand
the reasoning behind the other patch?
Powered by blists - more mailing lists