Trouble with RFS block addressing

Fan Deng enetor at gmail.com
Thu Aug 3 04:22:44 UTC 2017


Thanks Chris. I have created https://devel.rtems.org/ticket/3089#ticket and
assigned it to myself.

I already have a patch locally. Let me clean it up and send it over for
reviews.

On Tue, Aug 1, 2017 at 7:33 PM, Chris Johns <chrisj at rtems.org> wrote:

> On 28/07/2017 03:32, Deng Fan wrote:
> > Hi guys,
> >
>
> Hey nice to hear from you. I hope all is well.
>
> > I am experimenting with RFS. There is an issue around block addressing
> in RFS
> > that has been bothering me quite a bit.
> >
> > To my knowledge, there are two ways to ID a block in RFS:
> >
> > - Via a direct bno
> > - Via a group number and a bit (offset)
> >
> > They should be fully convertible (1-1 mapping).
>
> Correct.
>
> > However, the source code I am
> > reading is inconsistent in converting one to the other. Below is a
> summary of
> > the different equations used in the code.
> >
> > 1. In rtems_rfs_group_bitmap_alloc (rtems-rfs-group.c, line #172)
> > bno = group * group_blocks + bit
> >
> > 2. In rtems_rfs_group_bitmap_alloc (rtems-rfs-group.c, line #228)
> > bno = group * group_blocks + bit + 1 (via rtems_rfs_group_block()
> function)
> >
> > 3. In rtems_rfs_group_bitmap_free (rtems-rfs-group.c, line #283)
> > bno = group * group_blocks + bit + 1 (RTEMS_RFS_SUPERBLOCK_SIZE)
> >
> > 4. In rtems_rfs_group_bitmap_test (rtems-rfs-group.c, line #332)
> > bno = group * group_blocks + bit
> >
> > #1 and #4 are different from #2 and #3.
> >
> > I did a little test. On a newly formatted RFS partition, I called
> > rtems_rfs_group_bitmap_alloc() to allocate a block. Then check if the
> block is
> > allocated via rtems_rfs_group_bitmap_test. The result confirmed that the
> > addressing is inconsistent, as the bno returned by
> > rtems_rfs_group_bitmap_alloc() is unallocated according to
> > rtems_rfs_group_bitmap_test().
> >
> > Is there anything I interpreted incorrectly or is this a real issue?
> >
>
> It looks like a bug to me. Could you please create a ticket on 4.11 with a
> milestone to the next release?
>
> Any chance of a patch? Pretty please.
>
> Chris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20170802/6f31302a/attachment-0002.html>


More information about the users mailing list