<div dir="ltr">Thanks Chris. I have created <a href="https://devel.rtems.org/ticket/3089#ticket">https://devel.rtems.org/ticket/3089#ticket</a> and assigned it to myself.<div><br></div><div>I already have a patch locally. Let me clean it up and send it over for reviews.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 1, 2017 at 7:33 PM, Chris Johns <span dir="ltr"><<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 28/07/2017 03:32, Deng Fan wrote:<br>
> Hi guys,<br>
><br>
<br>
Hey nice to hear from you. I hope all is well.<br>
<span class=""><br>
> I am experimenting with RFS. There is an issue around block addressing in RFS<br>
> that has been bothering me quite a bit.<br>
><br>
> To my knowledge, there are two ways to ID a block in RFS:<br>
><br>
> - Via a direct bno<br>
> - Via a group number and a bit (offset)<br>
><br>
> They should be fully convertible (1-1 mapping).<br>
<br>
</span>Correct.<br>
<span class=""><br>
> However, the source code I am<br>
> reading is inconsistent in converting one to the other. Below is a summary of<br>
> the different equations used in the code.<br>
><br>
> 1. In rtems_rfs_group_bitmap_alloc (rtems-rfs-group.c, line #172)<br>
> bno = group * group_blocks + bit<br>
><br>
> 2. In rtems_rfs_group_bitmap_alloc (rtems-rfs-group.c, line #228)<br>
> bno = group * group_blocks + bit + 1 (via rtems_rfs_group_block() function)<br>
><br>
> 3. In rtems_rfs_group_bitmap_free (rtems-rfs-group.c, line #283)<br>
> bno = group * group_blocks + bit + 1 (RTEMS_RFS_SUPERBLOCK_SIZE)<br>
><br>
> 4. In rtems_rfs_group_bitmap_test (rtems-rfs-group.c, line #332)<br>
> bno = group * group_blocks + bit<br>
><br>
> #1 and #4 are different from #2 and #3.<br>
><br>
> I did a little test. On a newly formatted RFS partition, I called<br>
> rtems_rfs_group_bitmap_alloc() to allocate a block. Then check if the block is<br>
> allocated via rtems_rfs_group_bitmap_test. The result confirmed that the<br>
> addressing is inconsistent, as the bno returned by<br>
> rtems_rfs_group_bitmap_alloc() is unallocated according to<br>
> rtems_rfs_group_bitmap_test().<br>
><br>
> Is there anything I interpreted incorrectly or is this a real issue?<br>
><br>
<br>
</span>It looks like a bug to me. Could you please create a ticket on 4.11 with a<br>
milestone to the next release?<br>
<br>
Any chance of a patch? Pretty please.<br>
<span class="HOEnZb"><font color="#888888"><br>
Chris<br>
</font></span></blockquote></div><br></div>