diff mbox

libhandle: zap fdhash_head in fshandle_destroy

Message ID 20171206175401.GK19219@magnolia (mailing list archive)
State Accepted
Headers show

Commit Message

Darrick J. Wong Dec. 6, 2017, 5:54 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Set fdhash_head to zero once we've destroyed the handle list to avoid
dangling pointer problems.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libhandle/handle.c |    1 +
 1 file changed, 1 insertion(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Darrick J. Wong Dec. 7, 2017, 6:08 a.m. UTC | #1
On Wed, Dec 06, 2017 at 09:54:01AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Set fdhash_head to zero once we've destroyed the handle list to avoid
> dangling pointer problems.

Ping?

(The xfsprogs update announcement said to resend, but meh.)

--D

> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  libhandle/handle.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libhandle/handle.c b/libhandle/handle.c
> index e6971dd..878d14d 100644
> --- a/libhandle/handle.c
> +++ b/libhandle/handle.c
> @@ -73,6 +73,7 @@ fshandle_destroy(void)
>  		free(h);
>  		h = nexth;
>  	}
> +	fdhash_head = NULL;
>  }
>  
>  int
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/libhandle/handle.c b/libhandle/handle.c
index e6971dd..878d14d 100644
--- a/libhandle/handle.c
+++ b/libhandle/handle.c
@@ -73,6 +73,7 @@  fshandle_destroy(void)
 		free(h);
 		h = nexth;
 	}
+	fdhash_head = NULL;
 }
 
 int