Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yue Hu <zbestahu@gmail.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: Yue Hu <huyue2@coolpad.com>,
	linux-erofs@lists.ozlabs.org, zhangwen@coolpad.com
Subject: Re: [PATCH 1/2 v2] AOSP: erofs-utils: pass a parameter to write tail end in block list
Date: Tue, 15 Aug 2023 15:00:23 +0800	[thread overview]
Message-ID: <20230815150023.00001c8b.zbestahu@gmail.com> (raw)
In-Reply-To: <c31a3fb2-eb7a-9b99-6e2c-981f108db671@linux.alibaba.com>

On Tue, 15 Aug 2023 14:44:23 +0800
Gao Xiang <hsiangkao@linux.alibaba.com> wrote:

> On 2023/8/15 14:45, Yue Hu wrote:
> > On Tue, 15 Aug 2023 14:18:08 +0800
> > Gao Xiang <hsiangkao@linux.alibaba.com> wrote:
> >   
> >> On 2023/8/15 14:21, Yue Hu wrote:  
> >>> On Tue, 15 Aug 2023 13:36:46 +0800
> >>> Gao Xiang <hsiangkao@linux.alibaba.com> wrote:
> >>>      
> >>>> On 2023/8/15 13:40, Yue Hu wrote:  
> >>>>> On Tue, 15 Aug 2023 12:59:56 +0800
> >>>>> Gao Xiang <hsiangkao@linux.alibaba.com> wrote:
> >>>>>         
> >>>>>> On 2023/8/15 12:55, Yue Hu wrote:  
> >>>>>>> From: Yue Hu <huyue2@coolpad.com>
> >>>>>>>
> >>>>>>> We can determine whether the tail block is the first one or not during
> >>>>>>> the writing process.  Therefore, instead of internally checking the
> >>>>>>> block number for the tail block map, just simply pass the flag.
> >>>>>>>
> >>>>>>> Also, add the missing sbi argument to macro erofs_blknr.  
> >>>>>>
> >>>>>> Could you submit a patch to fix this issue first?  
> >>>>>
> >>>>> ok, will do that.
> >>>>>         
> >>>>>>        
> >>>>>>>
> >>>>>>> Signed-off-by: Yue Hu <huyue2@coolpad.com>
> >>>>>>> ---
> >>>>>>> v2: change commit message a bit
> >>>>>>>
> >>>>>>>      include/erofs/block_list.h | 4 ++--
> >>>>>>>      lib/block_list.c           | 5 ++---
> >>>>>>>      lib/inode.c                | 9 +++++++--
> >>>>>>>      3 files changed, 11 insertions(+), 7 deletions(-)
> >>>>>>>
> >>>>>>> diff --git a/include/erofs/block_list.h b/include/erofs/block_list.h
> >>>>>>> index 78fab44..e0dced8 100644
> >>>>>>> --- a/include/erofs/block_list.h
> >>>>>>> +++ b/include/erofs/block_list.h
> >>>>>>> @@ -19,7 +19,7 @@ void erofs_droid_blocklist_fclose(void);
> >>>>>>>      void erofs_droid_blocklist_write(struct erofs_inode *inode,
> >>>>>>>      				 erofs_blk_t blk_start, erofs_blk_t nblocks);
> >>>>>>>      void erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
> >>>>>>> -					  erofs_blk_t blkaddr);
> >>>>>>> +					  erofs_blk_t blkaddr, bool first_block);  
> >>>>>>
> >>>>>> I still have no idea why we need this, could you describe the Android
> >>>>>> block map details for discussion?  
> >>>>>
> >>>>> Android block map is just adding file blocks to a range.
> >>>>>
> >>>>> So, the tail block should be needed in this range as well.
> >>>>> I think one simple way is just appending the tail block address in it as below:
> >>>>>
> >>>>> /`file_path` `block1_address`-`blockn_address` `tail_block_address`  
> >>>>
> >>>> why `tail_block_address` needs a seperate field?  
> >>>
> >>> Well, `erofs_write_tail_end()` is a separate logic and i think appending this block is
> >>> simple enough since i don't need to consider whether the block address is contiguous
> >>> with previous one.
> >>>
> >>> And i think Android block map can handle this since i have saw below in ext4:
> >>>
> >>> /system/.../libclang_rt.ubsan_standalone-arm-android.so 51276-51309 0 51310-51403  
> >>
> >> What's the meaning of 0 here?  
> > 
> > I have not check that yet, maybe i need to find time...
> > 
> > And check this: "/.../libxxx.so 87378-88630 0 0 0 88631 0 0 88632-88637 0 0 0 88638-88663"
> > 
> > so, i guess it looks like null block.  
> 
> So here erofs_droid_blocklist_write_tail_end is not actually needed in principle?
> 0 is just used for sparse block?

We need to confirm this.

> 
> Thanks,
> Gao Xiang


      reply	other threads:[~2023-08-15  6:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15  4:55 [PATCH 1/2 v2] AOSP: erofs-utils: pass a parameter to write tail end in block list Yue Hu
2023-08-15  4:55 ` [PATCH 2/2] AOSP: erofs-utils: add a variable to validate tail block map " Yue Hu
2023-08-15  4:59 ` [PATCH 1/2 v2] AOSP: erofs-utils: pass a parameter to write tail end " Gao Xiang
2023-08-15  5:40   ` Yue Hu
2023-08-15  5:36     ` Gao Xiang
2023-08-15  6:21       ` Yue Hu
2023-08-15  6:18         ` Gao Xiang
2023-08-15  6:45           ` Yue Hu
2023-08-15  6:44             ` Gao Xiang
2023-08-15  7:00               ` Yue Hu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230815150023.00001c8b.zbestahu@gmail.com \
    --to=zbestahu@gmail.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=huyue2@coolpad.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=zhangwen@coolpad.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox