* [PATCH] Fix wrong flag ASSERT in xfs_attr_shortform_getvalue
@ 2012-03-30 16:24 Eric Sandeen
2012-03-31 15:39 ` Christoph Hellwig
2013-08-23 20:11 ` Ben Myers
0 siblings, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2012-03-30 16:24 UTC (permalink / raw)
To: xfs-oss
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.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
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 ...
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index 76d93dc..8ca76ad 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix wrong flag ASSERT in xfs_attr_shortform_getvalue
2012-03-30 16:24 [PATCH] Fix wrong flag ASSERT in xfs_attr_shortform_getvalue Eric Sandeen
@ 2012-03-31 15:39 ` Christoph Hellwig
2013-08-23 20:11 ` Ben Myers
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2012-03-31 15:39 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Fri, Mar 30, 2012 at 11:24:11AM -0500, Eric Sandeen wrote:
> 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.
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix wrong flag ASSERT in xfs_attr_shortform_getvalue
2012-03-30 16:24 [PATCH] Fix wrong flag ASSERT in xfs_attr_shortform_getvalue Eric Sandeen
2012-03-31 15:39 ` Christoph Hellwig
@ 2013-08-23 20:11 ` Ben Myers
2013-08-23 20:17 ` Eric Sandeen
1 sibling, 1 reply; 5+ messages in thread
From: Ben Myers @ 2013-08-23 20:11 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
Hey Eric,
On Fri, Mar 30, 2012 at 11:24:11AM -0500, Eric Sandeen wrote:
> 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.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Looks like this one fell through the cracks. You still interested in merging
it?
Thanks,
Ben
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix wrong flag ASSERT in xfs_attr_shortform_getvalue
2013-08-23 20:11 ` Ben Myers
@ 2013-08-23 20:17 ` Eric Sandeen
2013-08-30 20:21 ` Ben Myers
0 siblings, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2013-08-23 20:17 UTC (permalink / raw)
To: Ben Myers; +Cc: Eric Sandeen, xfs-oss
On Aug 23, 2013, at 3:11 PM, Ben Myers <bpm@sgi.com> wrote:
> Hey Eric,
>
> On Fri, Mar 30, 2012 at 11:24:11AM -0500, Eric Sandeen wrote:
>> 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.
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>
> 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
> Thanks,
> Ben
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix wrong flag ASSERT in xfs_attr_shortform_getvalue
2013-08-23 20:17 ` Eric Sandeen
@ 2013-08-30 20:21 ` Ben Myers
0 siblings, 0 replies; 5+ messages in thread
From: Ben Myers @ 2013-08-30 20:21 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Fri, Aug 23, 2013 at 04:17:07PM -0400, Eric Sandeen wrote:
> On Aug 23, 2013, at 3:11 PM, Ben Myers <bpm@sgi.com> wrote:
>
> > Hey Eric,
> >
> > On Fri, Mar 30, 2012 at 11:24:11AM -0500, Eric Sandeen wrote:
> >> 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.
> >>
> >> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> >
> > 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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-08-30 20:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 16:24 [PATCH] Fix wrong flag ASSERT in xfs_attr_shortform_getvalue Eric Sandeen
2012-03-31 15:39 ` Christoph Hellwig
2013-08-23 20:11 ` Ben Myers
2013-08-23 20:17 ` Eric Sandeen
2013-08-30 20:21 ` Ben Myers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox