[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZnPjpCovlQq7_ptP@infradead.org>
Date: Thu, 20 Jun 2024 01:09:08 -0700
From: Christoph Hellwig <hch@...radead.org>
To: shaozongfan <shaozongfan@...inos.cn>
Cc: chandan.babu@...cle.com, djwong@...nel.org, linux-xfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xfs: fix a NULL pointer problem
On Thu, Jun 20, 2024 at 03:43:13PM +0800, shaozongfan wrote:
> when a process using getdents64() api to get a Folder inside
> the file directory,meantime other process delete the file
> directory.it would cause an error like this:
Can you share your reproducer?
> if (ctx->pos <= dotdot_offset) {
> - ino = xfs_dir2_sf_get_parent_ino(sfp);
> + sfp1 = sfp;
> + if (sfp1 == NULL)
> + return 0;
> + ino = xfs_dir2_sf_get_parent_ino(sfp1);
This looks ... odd. Assigning one pointer variable to another
doesn't revalidate anything. And xfs_dir2_sf_getdents is called
with the iolock held, which should prevent xfs_idestroy_fork
from racing with it. And if for some reason it doesn't we need
to fix the synchronization.
Powered by blists - more mailing lists