linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname
@ 2019-03-11 16:19 Darrick J. Wong
  2019-03-11 16:22 ` [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname Darrick J. Wong
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Darrick J. Wong @ 2019-03-11 16:19 UTC (permalink / raw)
  To: linux-xfs
  Cc: Nathan Chancellor, linux-kernel, Nick Desaulniers, clang-built-linux

From: Darrick J. Wong <darrick.wong@oracle.com>

Smatch complains about the following:

fs/xfs/libxfs/xfs_dir2_leaf.c:848 xfs_dir2_leaf_addname() error:
uninitialized symbol 'lowstale'.

fs/xfs/libxfs/xfs_dir2_leaf.c:849 xfs_dir2_leaf_addname() error:
uninitialized symbol 'highstale'.

I don't think there's any incorrect behavior associated with the
uninitialized variable, but as the author of the previous zero-init
patch points out, it's best not to be passing around pointers to
uninitialized stack areas.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_dir2_leaf.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
index 9a3767818c50..2abf945e5844 100644
--- a/fs/xfs/libxfs/xfs_dir2_leaf.c
+++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
@@ -574,7 +574,7 @@ xfs_dir2_leaf_addname(
 	xfs_dir2_data_unused_t	*dup;		/* data unused entry */
 	int			error;		/* error return value */
 	int			grown;		/* allocated new data block */
-	int			highstale;	/* index of next stale leaf */
+	int			highstale = 0;	/* index of next stale leaf */
 	int			i;		/* temporary, index */
 	int			index;		/* leaf table position */
 	struct xfs_buf		*lbp;		/* leaf's buffer */
@@ -583,7 +583,7 @@ xfs_dir2_leaf_addname(
 	xfs_dir2_leaf_entry_t	*lep;		/* leaf entry table pointer */
 	int			lfloglow;	/* low leaf logging index */
 	int			lfloghigh;	/* high leaf logging index */
-	int			lowstale;	/* index of prev stale leaf */
+	int			lowstale = 0;	/* index of prev stale leaf */
 	xfs_dir2_leaf_tail_t	*ltp;		/* leaf tail pointer */
 	int			needbytes;	/* leaf block bytes needed */
 	int			needlog;	/* need to log data header */

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname
  2019-03-11 16:19 [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname Darrick J. Wong
@ 2019-03-11 16:22 ` Darrick J. Wong
  2019-03-11 17:12   ` Allison Henderson
  2019-03-12 14:23   ` Bill O'Donnell
  2019-03-11 16:46 ` [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname Nathan Chancellor
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2019-03-11 16:22 UTC (permalink / raw)
  To: linux-xfs
  Cc: Nathan Chancellor, linux-kernel, Nick Desaulniers, clang-built-linux

From: Darrick J. Wong <darrick.wong@oracle.com>

Remove typedefs and consolidate local variable initialization.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_dir2_leaf.c |   33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
index 2abf945e5844..9c2a0a13ed61 100644
--- a/fs/xfs/libxfs/xfs_dir2_leaf.c
+++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
@@ -563,43 +563,40 @@ xfs_dir3_leaf_find_entry(
  */
 int						/* error */
 xfs_dir2_leaf_addname(
-	xfs_da_args_t		*args)		/* operation arguments */
+	struct xfs_da_args	*args)		/* operation arguments */
 {
+	struct xfs_dir3_icleaf_hdr leafhdr;
+	struct xfs_trans	*tp = args->trans;
 	__be16			*bestsp;	/* freespace table in leaf */
-	int			compact;	/* need to compact leaves */
-	xfs_dir2_data_hdr_t	*hdr;		/* data block header */
+	__be16			*tagp;		/* end of data entry */
 	struct xfs_buf		*dbp;		/* data block buffer */
-	xfs_dir2_data_entry_t	*dep;		/* data block entry */
-	xfs_inode_t		*dp;		/* incore directory inode */
-	xfs_dir2_data_unused_t	*dup;		/* data unused entry */
+	struct xfs_buf		*lbp;		/* leaf's buffer */
+	struct xfs_dir2_leaf	*leaf;		/* leaf structure */
+	struct xfs_inode	*dp = args->dp;	/* incore directory inode */
+	struct xfs_dir2_data_hdr *hdr;		/* data block header */
+	struct xfs_dir2_data_entry *dep;	/* data block entry */
+	struct xfs_dir2_leaf_entry *lep;	/* leaf entry table pointer */
+	struct xfs_dir2_leaf_entry *ents;
+	struct xfs_dir2_data_unused *dup;	/* data unused entry */
+	struct xfs_dir2_leaf_tail *ltp;		/* leaf tail pointer */
+	struct xfs_dir2_data_free *bf;		/* bestfree table */
+	int			compact;	/* need to compact leaves */
 	int			error;		/* error return value */
 	int			grown;		/* allocated new data block */
 	int			highstale = 0;	/* index of next stale leaf */
 	int			i;		/* temporary, index */
 	int			index;		/* leaf table position */
-	struct xfs_buf		*lbp;		/* leaf's buffer */
-	xfs_dir2_leaf_t		*leaf;		/* leaf structure */
 	int			length;		/* length of new entry */
-	xfs_dir2_leaf_entry_t	*lep;		/* leaf entry table pointer */
 	int			lfloglow;	/* low leaf logging index */
 	int			lfloghigh;	/* high leaf logging index */
 	int			lowstale = 0;	/* index of prev stale leaf */
-	xfs_dir2_leaf_tail_t	*ltp;		/* leaf tail pointer */
 	int			needbytes;	/* leaf block bytes needed */
 	int			needlog;	/* need to log data header */
 	int			needscan;	/* need to rescan data free */
-	__be16			*tagp;		/* end of data entry */
-	xfs_trans_t		*tp;		/* transaction pointer */
 	xfs_dir2_db_t		use_block;	/* data block number */
-	struct xfs_dir2_data_free *bf;		/* bestfree table */
-	struct xfs_dir2_leaf_entry *ents;
-	struct xfs_dir3_icleaf_hdr leafhdr;
 
 	trace_xfs_dir2_leaf_addname(args);
 
-	dp = args->dp;
-	tp = args->trans;
-
 	error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp);
 	if (error)
 		return error;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname
  2019-03-11 16:19 [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname Darrick J. Wong
  2019-03-11 16:22 ` [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname Darrick J. Wong
@ 2019-03-11 16:46 ` Nathan Chancellor
  2019-03-11 17:11 ` Allison Henderson
  2019-03-12 14:22 ` Bill O'Donnell
  3 siblings, 0 replies; 7+ messages in thread
From: Nathan Chancellor @ 2019-03-11 16:46 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: linux-xfs, linux-kernel, Nick Desaulniers, clang-built-linux

On Mon, Mar 11, 2019 at 09:19:48AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Smatch complains about the following:
> 
> fs/xfs/libxfs/xfs_dir2_leaf.c:848 xfs_dir2_leaf_addname() error:
> uninitialized symbol 'lowstale'.
> 
> fs/xfs/libxfs/xfs_dir2_leaf.c:849 xfs_dir2_leaf_addname() error:
> uninitialized symbol 'highstale'.
> 
> I don't think there's any incorrect behavior associated with the
> uninitialized variable, but as the author of the previous zero-init
> patch points out, it's best not to be passing around pointers to
> uninitialized stack areas.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

Thanks for this!

> ---
>  fs/xfs/libxfs/xfs_dir2_leaf.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
> index 9a3767818c50..2abf945e5844 100644
> --- a/fs/xfs/libxfs/xfs_dir2_leaf.c
> +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
> @@ -574,7 +574,7 @@ xfs_dir2_leaf_addname(
>  	xfs_dir2_data_unused_t	*dup;		/* data unused entry */
>  	int			error;		/* error return value */
>  	int			grown;		/* allocated new data block */
> -	int			highstale;	/* index of next stale leaf */
> +	int			highstale = 0;	/* index of next stale leaf */
>  	int			i;		/* temporary, index */
>  	int			index;		/* leaf table position */
>  	struct xfs_buf		*lbp;		/* leaf's buffer */
> @@ -583,7 +583,7 @@ xfs_dir2_leaf_addname(
>  	xfs_dir2_leaf_entry_t	*lep;		/* leaf entry table pointer */
>  	int			lfloglow;	/* low leaf logging index */
>  	int			lfloghigh;	/* high leaf logging index */
> -	int			lowstale;	/* index of prev stale leaf */
> +	int			lowstale = 0;	/* index of prev stale leaf */
>  	xfs_dir2_leaf_tail_t	*ltp;		/* leaf tail pointer */
>  	int			needbytes;	/* leaf block bytes needed */
>  	int			needlog;	/* need to log data header */

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname
  2019-03-11 16:19 [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname Darrick J. Wong
  2019-03-11 16:22 ` [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname Darrick J. Wong
  2019-03-11 16:46 ` [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname Nathan Chancellor
@ 2019-03-11 17:11 ` Allison Henderson
  2019-03-12 14:22 ` Bill O'Donnell
  3 siblings, 0 replies; 7+ messages in thread
From: Allison Henderson @ 2019-03-11 17:11 UTC (permalink / raw)
  To: Darrick J. Wong, linux-xfs
  Cc: Nathan Chancellor, linux-kernel, Nick Desaulniers, clang-built-linux

Looks fine.  You can add my review.  Thx!

Reviewed-by: Allison Henderson <allison.henderson@oracle.com>

On 3/11/19 9:19 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Smatch complains about the following:
> 
> fs/xfs/libxfs/xfs_dir2_leaf.c:848 xfs_dir2_leaf_addname() error:
> uninitialized symbol 'lowstale'.
> 
> fs/xfs/libxfs/xfs_dir2_leaf.c:849 xfs_dir2_leaf_addname() error:
> uninitialized symbol 'highstale'.
> 
> I don't think there's any incorrect behavior associated with the
> uninitialized variable, but as the author of the previous zero-init
> patch points out, it's best not to be passing around pointers to
> uninitialized stack areas.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>   fs/xfs/libxfs/xfs_dir2_leaf.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
> index 9a3767818c50..2abf945e5844 100644
> --- a/fs/xfs/libxfs/xfs_dir2_leaf.c
> +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
> @@ -574,7 +574,7 @@ xfs_dir2_leaf_addname(
>   	xfs_dir2_data_unused_t	*dup;		/* data unused entry */
>   	int			error;		/* error return value */
>   	int			grown;		/* allocated new data block */
> -	int			highstale;	/* index of next stale leaf */
> +	int			highstale = 0;	/* index of next stale leaf */
>   	int			i;		/* temporary, index */
>   	int			index;		/* leaf table position */
>   	struct xfs_buf		*lbp;		/* leaf's buffer */
> @@ -583,7 +583,7 @@ xfs_dir2_leaf_addname(
>   	xfs_dir2_leaf_entry_t	*lep;		/* leaf entry table pointer */
>   	int			lfloglow;	/* low leaf logging index */
>   	int			lfloghigh;	/* high leaf logging index */
> -	int			lowstale;	/* index of prev stale leaf */
> +	int			lowstale = 0;	/* index of prev stale leaf */
>   	xfs_dir2_leaf_tail_t	*ltp;		/* leaf tail pointer */
>   	int			needbytes;	/* leaf block bytes needed */
>   	int			needlog;	/* need to log data header */
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname
  2019-03-11 16:22 ` [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname Darrick J. Wong
@ 2019-03-11 17:12   ` Allison Henderson
  2019-03-12 14:23   ` Bill O'Donnell
  1 sibling, 0 replies; 7+ messages in thread
From: Allison Henderson @ 2019-03-11 17:12 UTC (permalink / raw)
  To: Darrick J. Wong, linux-xfs
  Cc: Nathan Chancellor, linux-kernel, Nick Desaulniers, clang-built-linux

Looks ok to me.  Thanks for the clean up.

Reviewed-by: Allison Henderson <allison.henderson@oracle.com>

On 3/11/19 9:22 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Remove typedefs and consolidate local variable initialization.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>   fs/xfs/libxfs/xfs_dir2_leaf.c |   33 +++++++++++++++------------------
>   1 file changed, 15 insertions(+), 18 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
> index 2abf945e5844..9c2a0a13ed61 100644
> --- a/fs/xfs/libxfs/xfs_dir2_leaf.c
> +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
> @@ -563,43 +563,40 @@ xfs_dir3_leaf_find_entry(
>    */
>   int						/* error */
>   xfs_dir2_leaf_addname(
> -	xfs_da_args_t		*args)		/* operation arguments */
> +	struct xfs_da_args	*args)		/* operation arguments */
>   {
> +	struct xfs_dir3_icleaf_hdr leafhdr;
> +	struct xfs_trans	*tp = args->trans;
>   	__be16			*bestsp;	/* freespace table in leaf */
> -	int			compact;	/* need to compact leaves */
> -	xfs_dir2_data_hdr_t	*hdr;		/* data block header */
> +	__be16			*tagp;		/* end of data entry */
>   	struct xfs_buf		*dbp;		/* data block buffer */
> -	xfs_dir2_data_entry_t	*dep;		/* data block entry */
> -	xfs_inode_t		*dp;		/* incore directory inode */
> -	xfs_dir2_data_unused_t	*dup;		/* data unused entry */
> +	struct xfs_buf		*lbp;		/* leaf's buffer */
> +	struct xfs_dir2_leaf	*leaf;		/* leaf structure */
> +	struct xfs_inode	*dp = args->dp;	/* incore directory inode */
> +	struct xfs_dir2_data_hdr *hdr;		/* data block header */
> +	struct xfs_dir2_data_entry *dep;	/* data block entry */
> +	struct xfs_dir2_leaf_entry *lep;	/* leaf entry table pointer */
> +	struct xfs_dir2_leaf_entry *ents;
> +	struct xfs_dir2_data_unused *dup;	/* data unused entry */
> +	struct xfs_dir2_leaf_tail *ltp;		/* leaf tail pointer */
> +	struct xfs_dir2_data_free *bf;		/* bestfree table */
> +	int			compact;	/* need to compact leaves */
>   	int			error;		/* error return value */
>   	int			grown;		/* allocated new data block */
>   	int			highstale = 0;	/* index of next stale leaf */
>   	int			i;		/* temporary, index */
>   	int			index;		/* leaf table position */
> -	struct xfs_buf		*lbp;		/* leaf's buffer */
> -	xfs_dir2_leaf_t		*leaf;		/* leaf structure */
>   	int			length;		/* length of new entry */
> -	xfs_dir2_leaf_entry_t	*lep;		/* leaf entry table pointer */
>   	int			lfloglow;	/* low leaf logging index */
>   	int			lfloghigh;	/* high leaf logging index */
>   	int			lowstale = 0;	/* index of prev stale leaf */
> -	xfs_dir2_leaf_tail_t	*ltp;		/* leaf tail pointer */
>   	int			needbytes;	/* leaf block bytes needed */
>   	int			needlog;	/* need to log data header */
>   	int			needscan;	/* need to rescan data free */
> -	__be16			*tagp;		/* end of data entry */
> -	xfs_trans_t		*tp;		/* transaction pointer */
>   	xfs_dir2_db_t		use_block;	/* data block number */
> -	struct xfs_dir2_data_free *bf;		/* bestfree table */
> -	struct xfs_dir2_leaf_entry *ents;
> -	struct xfs_dir3_icleaf_hdr leafhdr;
>   
>   	trace_xfs_dir2_leaf_addname(args);
>   
> -	dp = args->dp;
> -	tp = args->trans;
> -
>   	error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp);
>   	if (error)
>   		return error;
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname
  2019-03-11 16:19 [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname Darrick J. Wong
                   ` (2 preceding siblings ...)
  2019-03-11 17:11 ` Allison Henderson
@ 2019-03-12 14:22 ` Bill O'Donnell
  3 siblings, 0 replies; 7+ messages in thread
From: Bill O'Donnell @ 2019-03-12 14:22 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: linux-xfs, Nathan Chancellor, linux-kernel, Nick Desaulniers,
	clang-built-linux

On Mon, Mar 11, 2019 at 09:19:48AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Smatch complains about the following:
> 
> fs/xfs/libxfs/xfs_dir2_leaf.c:848 xfs_dir2_leaf_addname() error:
> uninitialized symbol 'lowstale'.
> 
> fs/xfs/libxfs/xfs_dir2_leaf.c:849 xfs_dir2_leaf_addname() error:
> uninitialized symbol 'highstale'.
> 
> I don't think there's any incorrect behavior associated with the
> uninitialized variable, but as the author of the previous zero-init
> patch points out, it's best not to be passing around pointers to
> uninitialized stack areas.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Bill O'Donnell <billodo@redhat.com>

> ---
>  fs/xfs/libxfs/xfs_dir2_leaf.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
> index 9a3767818c50..2abf945e5844 100644
> --- a/fs/xfs/libxfs/xfs_dir2_leaf.c
> +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
> @@ -574,7 +574,7 @@ xfs_dir2_leaf_addname(
>  	xfs_dir2_data_unused_t	*dup;		/* data unused entry */
>  	int			error;		/* error return value */
>  	int			grown;		/* allocated new data block */
> -	int			highstale;	/* index of next stale leaf */
> +	int			highstale = 0;	/* index of next stale leaf */
>  	int			i;		/* temporary, index */
>  	int			index;		/* leaf table position */
>  	struct xfs_buf		*lbp;		/* leaf's buffer */
> @@ -583,7 +583,7 @@ xfs_dir2_leaf_addname(
>  	xfs_dir2_leaf_entry_t	*lep;		/* leaf entry table pointer */
>  	int			lfloglow;	/* low leaf logging index */
>  	int			lfloghigh;	/* high leaf logging index */
> -	int			lowstale;	/* index of prev stale leaf */
> +	int			lowstale = 0;	/* index of prev stale leaf */
>  	xfs_dir2_leaf_tail_t	*ltp;		/* leaf tail pointer */
>  	int			needbytes;	/* leaf block bytes needed */
>  	int			needlog;	/* need to log data header */

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname
  2019-03-11 16:22 ` [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname Darrick J. Wong
  2019-03-11 17:12   ` Allison Henderson
@ 2019-03-12 14:23   ` Bill O'Donnell
  1 sibling, 0 replies; 7+ messages in thread
From: Bill O'Donnell @ 2019-03-12 14:23 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: linux-xfs, Nathan Chancellor, linux-kernel, Nick Desaulniers,
	clang-built-linux

On Mon, Mar 11, 2019 at 09:22:32AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Remove typedefs and consolidate local variable initialization.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Bill O'Donnell <billodo@redhat.com>

> ---
>  fs/xfs/libxfs/xfs_dir2_leaf.c |   33 +++++++++++++++------------------
>  1 file changed, 15 insertions(+), 18 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
> index 2abf945e5844..9c2a0a13ed61 100644
> --- a/fs/xfs/libxfs/xfs_dir2_leaf.c
> +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
> @@ -563,43 +563,40 @@ xfs_dir3_leaf_find_entry(
>   */
>  int						/* error */
>  xfs_dir2_leaf_addname(
> -	xfs_da_args_t		*args)		/* operation arguments */
> +	struct xfs_da_args	*args)		/* operation arguments */
>  {
> +	struct xfs_dir3_icleaf_hdr leafhdr;
> +	struct xfs_trans	*tp = args->trans;
>  	__be16			*bestsp;	/* freespace table in leaf */
> -	int			compact;	/* need to compact leaves */
> -	xfs_dir2_data_hdr_t	*hdr;		/* data block header */
> +	__be16			*tagp;		/* end of data entry */
>  	struct xfs_buf		*dbp;		/* data block buffer */
> -	xfs_dir2_data_entry_t	*dep;		/* data block entry */
> -	xfs_inode_t		*dp;		/* incore directory inode */
> -	xfs_dir2_data_unused_t	*dup;		/* data unused entry */
> +	struct xfs_buf		*lbp;		/* leaf's buffer */
> +	struct xfs_dir2_leaf	*leaf;		/* leaf structure */
> +	struct xfs_inode	*dp = args->dp;	/* incore directory inode */
> +	struct xfs_dir2_data_hdr *hdr;		/* data block header */
> +	struct xfs_dir2_data_entry *dep;	/* data block entry */
> +	struct xfs_dir2_leaf_entry *lep;	/* leaf entry table pointer */
> +	struct xfs_dir2_leaf_entry *ents;
> +	struct xfs_dir2_data_unused *dup;	/* data unused entry */
> +	struct xfs_dir2_leaf_tail *ltp;		/* leaf tail pointer */
> +	struct xfs_dir2_data_free *bf;		/* bestfree table */
> +	int			compact;	/* need to compact leaves */
>  	int			error;		/* error return value */
>  	int			grown;		/* allocated new data block */
>  	int			highstale = 0;	/* index of next stale leaf */
>  	int			i;		/* temporary, index */
>  	int			index;		/* leaf table position */
> -	struct xfs_buf		*lbp;		/* leaf's buffer */
> -	xfs_dir2_leaf_t		*leaf;		/* leaf structure */
>  	int			length;		/* length of new entry */
> -	xfs_dir2_leaf_entry_t	*lep;		/* leaf entry table pointer */
>  	int			lfloglow;	/* low leaf logging index */
>  	int			lfloghigh;	/* high leaf logging index */
>  	int			lowstale = 0;	/* index of prev stale leaf */
> -	xfs_dir2_leaf_tail_t	*ltp;		/* leaf tail pointer */
>  	int			needbytes;	/* leaf block bytes needed */
>  	int			needlog;	/* need to log data header */
>  	int			needscan;	/* need to rescan data free */
> -	__be16			*tagp;		/* end of data entry */
> -	xfs_trans_t		*tp;		/* transaction pointer */
>  	xfs_dir2_db_t		use_block;	/* data block number */
> -	struct xfs_dir2_data_free *bf;		/* bestfree table */
> -	struct xfs_dir2_leaf_entry *ents;
> -	struct xfs_dir3_icleaf_hdr leafhdr;
>  
>  	trace_xfs_dir2_leaf_addname(args);
>  
> -	dp = args->dp;
> -	tp = args->trans;
> -
>  	error = xfs_dir3_leaf_read(tp, dp, args->geo->leafblk, -1, &lbp);
>  	if (error)
>  		return error;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-12 14:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 16:19 [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname Darrick J. Wong
2019-03-11 16:22 ` [PATCH 2/2] xfs: clean up xfs_dir2_leaf_addname Darrick J. Wong
2019-03-11 17:12   ` Allison Henderson
2019-03-12 14:23   ` Bill O'Donnell
2019-03-11 16:46 ` [PATCH 1/2] xfs: zero initialize highstale and lowstale in xfs_dir2_leaf_addname Nathan Chancellor
2019-03-11 17:11 ` Allison Henderson
2019-03-12 14:22 ` Bill O'Donnell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).