All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] xfs: Add delay ready attr remove routines
@ 2021-06-17 14:22 Dan Carpenter
  2021-06-22  7:59 ` Allison Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-06-17 14:22 UTC (permalink / raw)
  To: allison.henderson; +Cc: Allison Henderson, linux-xfs

Hello Allison Henderson,

The patch 2b74b03c13c4: "xfs: Add delay ready attr remove routines"
from Apr 26, 2021, leads to the following static checker warning:

	fs/xfs/libxfs/xfs_attr.c:1481 xfs_attr_remove_iter()
	error: uninitialized symbol 'error'.

fs/xfs/libxfs/xfs_attr.c
  1469                          return -EAGAIN;
  1470                  }
  1471  
  1472                  /* fallthrough */
  1473          case XFS_DAS_RM_SHRINK:
  1474                  /*
  1475                   * If the result is small enough, push it all into the inode.
  1476                   * This is our final state so it's safe to return a dirty
  1477                   * transaction.
  1478                   */
  1479                  if (xfs_attr_is_leaf(dp))
  1480                          error = xfs_attr_node_shrink(args, state);
  1481                  ASSERT(error != -EAGAIN);

Not initialized on the else path.  It should be zero right?

  1482                  break;
  1483          default:
  1484                  ASSERT(0);
  1485                  error = -EINVAL;
  1486                  goto out;
  1487          }
  1488  out:
  1489          if (state)
  1490                  xfs_da_state_free(state);
  1491          return error;
                ^^^^^^^^^^^^
returned here.

  1492  }

regards,
dan carpenter

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

* Re: [bug report] xfs: Add delay ready attr remove routines
  2021-06-17 14:22 [bug report] xfs: Add delay ready attr remove routines Dan Carpenter
@ 2021-06-22  7:59 ` Allison Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Allison Henderson @ 2021-06-22  7:59 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-xfs



On 6/17/21 7:22 AM, Dan Carpenter wrote:
> Hello Allison Henderson,
> 
> The patch 2b74b03c13c4: "xfs: Add delay ready attr remove routines"
> from Apr 26, 2021, leads to the following static checker warning:
> 
> 	fs/xfs/libxfs/xfs_attr.c:1481 xfs_attr_remove_iter()
> 	error: uninitialized symbol 'error'.
> 
> fs/xfs/libxfs/xfs_attr.c
>    1469                          return -EAGAIN;
>    1470                  }
>    1471
>    1472                  /* fallthrough */
>    1473          case XFS_DAS_RM_SHRINK:
>    1474                  /*
>    1475                   * If the result is small enough, push it all into the inode.
>    1476                   * This is our final state so it's safe to return a dirty
>    1477                   * transaction.
>    1478                   */
>    1479                  if (xfs_attr_is_leaf(dp))
>    1480                          error = xfs_attr_node_shrink(args, state);
>    1481                  ASSERT(error != -EAGAIN);
> 
> Not initialized on the else path.  It should be zero right?
Hi Dan,

Thanks for the catch, I just noticed this report.  I will sent out a 
patch initializing error at the start of the function.  That should take 
care of this warning.

Thx!
Allison
> 
>    1482                  break;
>    1483          default:
>    1484                  ASSERT(0);
>    1485                  error = -EINVAL;
>    1486                  goto out;
>    1487          }
>    1488  out:
>    1489          if (state)
>    1490                  xfs_da_state_free(state);
>    1491          return error;
>                  ^^^^^^^^^^^^
> returned here.
> 
>    1492  }
> 
> regards,
> dan carpenter
> 

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

end of thread, other threads:[~2021-06-22  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 14:22 [bug report] xfs: Add delay ready attr remove routines Dan Carpenter
2021-06-22  7:59 ` Allison Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.