Re: [f2fs-dev] [RFC PATCH 3/9] f2fs: support regular file buffered writes on large folios
Chao Yu via Linux-f2fs-devel <[email protected]>
| Newsgroups | net.sourceforge.lists.linux-f2fs-devel |
|---|---|
| Message-ID | <[email protected]> |
On 7/10/26 15:44, Nanzhe Zhao wrote: >>> Both the error path and the normal path will eventually reach the out label path, >>> and out will call f2fs_put_dnode(&dn) if get_dn is true. >>> Or am I missing something? >> >> For above case: both head and tail has partial updated data, then we call >> f2fs_get_dnode_of_data() twice, but call f2fs_put_dnode() once? > > I think f2fs_put_dnode() will be called twice in that case. > > The out label is still inside the while loop body. For each block returned by It's not in 3/9 at least: + } + +out: + if (get_dn) + f2fs_put_dnode(&dn); + + return err; +} > f2fs_find_next_need_read_block(), get_dn is reset to false first. If > f2fs_get_dnode_of_data() succeeds, get_dn is set to true, and the same > iteration will fall through/goto out and call f2fs_put_dnode(&dn). > > So for head and tail, the flow should be: > > head: get dnode -> read/zero -> out -> put dnode > tail: get dnode -> read/zero -> out -> put dnode > > If head and tail are the same block, the first iteration marks it uptodate, > so the next f2fs_find_next_need_read_block() will not return it again. > > Hmmm, if the current control flow is so easy to misread, would you like me > to change it a bit to make the per-iteration dnode lifetime more obvious? > > Thanks, > _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel