Fix wrong flag ASSERT in xfs_attr_shortform_getvalue
PATCH 1/1 Fix wrong flag ASSERT in xfs_attr_shortform_getvalue
This ASSERT is testing an if_flags flag value against a di_aformat enum value. di_aformat is never assigned XFS_IFINLINE.
This happens to work for now, because XFS_IFINLINE has the same value as XFS_DINODE_FMT_LOCAL, and that's tested just before we call this function.
However, I think the intention is to assert that we have read in the data, i.e. XFS_IFINLINE on if_flags, before we use if_data. This is done in other places through the code as well.
---
Note, maybe it should be:
ASSERT(args->dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL);
but there is an if statement in the caller which assures that, so as the code stands that would seem pointless. I'm not 100% sure what the original intent was, though, so ...
fs/xfs/xfs_attr_leaf.c +1 -1
@@ -441,7 +441,7 @@ xfs_attr_shortform_getvalue(xfs_da_args_t *args)xfs_attr_sf_entry_t *sfe;int i; -ASSERT (args->dp->i_d.di_aformat ==XFS_IFINLINE ); +ASSERT (args->dp->i_afp->if_flags ==XFS_IFINLINE ); sf = (xfs_attr_shortform_t *)args->dp->i_afp->if_u1.if_data; sfe = &sf->list[0 ]; for (i = 0; i < sf->hdr.count;
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 4 lines · Eric Sandeen
This ASSERT is testing an
if_flagsflag value against adi_aformatenum value.di_aformatis never assignedXFS_IFINLINE.
Quoted 8 lines
This happens to work for now, because
XFS_IFINLINEhas the same value asXFS_DINODE_FMT_LOCAL, and that's tested just before we call this function.However, I think the intention is to assert that we have read in the data, i.e.
XFS_IFINLINEonif_flags, before we useif_data. This is done in other places through the code as well.
Looks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Hey Eric,
Quoted 8 lines · Eric Sandeen
This ASSERT is testing an
if_flagsflag value against adi_aformatenum value.di_aformatis never assignedXFS_IFINLINE.This happens to work for now, because
XFS_IFINLINEhas the same value asXFS_DINODE_FMT_LOCAL, and that's tested just before we call this function.
Quoted 6 lines
However, I think the intention is to assert that we have read in the data, i.e.
XFS_IFINLINEonif_flags, before we useif_data. This is done in other places through the code as well.Signed-off-by Eric Sandeen <[email protected]>
Looks like this one fell through the cracks. You still interested in merging it?
Thanks,
Ben
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 16 lines · Ben Myers
Hey Eric,
Quoted 13 lines · Eric Sandeen
This ASSERT is testing an
if_flagsflag value against adi_aformatenum value.di_aformatis never assignedXFS_IFINLINE.This happens to work for now, because
XFS_IFINLINEhas the same value asXFS_DINODE_FMT_LOCAL, and that's tested just before we call this function.However, I think the intention is to assert that we have read in the data, i.e.
XFS_IFINLINEonif_flags, before we useif_data. This is done in other places through the code as well.
Quoted 5 lines
Quoted 1 line
Signed-off-by Eric Sandeen <[email protected]>Looks like this one fell through the cracks. You still interested in merging it?
Yep - it's fallen out of my brain by mow but if it was correct then I think it's correct now...
Eric
Quoted 2 lines
Thanks,
Ben
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Ben Myers
AppliedQuoted 18 lines · Eric Sandeen
Quoted 16 lines · Ben Myers
Hey Eric,
Quoted 13 lines · Eric Sandeen
This ASSERT is testing an
if_flagsflag value against adi_aformatenum value.di_aformatis never assignedXFS_IFINLINE.This happens to work for now, because
XFS_IFINLINEhas the same value asXFS_DINODE_FMT_LOCAL, and that's tested just before we call this function.However, I think the intention is to assert that we have read in the data, i.e.
XFS_IFINLINEonif_flags, before we useif_data. This is done in other places through the code as well.
Quoted 6 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Eric Sandeen <[email protected]>Looks like this one fell through the cracks. You still interested in merging it?
Yep - it's fallen out of my brain by mow but if it was correct then I think it's correct now...
Applied.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs