Linux-EROFS Archive on lore.kernel.org
 help / color / Atom feed
From: "huangjianan@oppo.com" <huangjianan@oppo.com>
To: "Gao Xiang" <hsiangkao@aol.com>
Cc: guoweichao <guoweichao@oppo.com>,
	linux-erofs <linux-erofs@lists.ozlabs.org>,
	zhangshiming <zhangshiming@oppo.com>
Subject: 回复: [WIP] [PATCH 04/12] erofs-utils: fuse: adjust larger extent handling
Date: Mon, 19 Oct 2020 11:13:42 +0800
Message-ID: <2020101911134102451012@oppo.com> (raw)
In-Reply-To: <20201017051621.7810-5-hsiangkao@aol.com>


[-- Attachment #1: Type: text/plain, Size: 2536 bytes --]

Hi, Gao Xiang,
________________________________

发件人: Gao Xiang<mailto:hsiangkao@aol.com>
发送时间: 2020-10-17 13:16
收件人: linux-erofs<mailto:linux-erofs@lists.ozlabs.org>
抄送: Huang Jianan<mailto:huangjianan@oppo.com>; Li Guifu<mailto:bluce.liguifu@huawei.com>; Li Guifu<mailto:bluce.lee@aliyun.com>; Chao Yu<mailto:chao@kernel.org>; Guo Weichao<mailto:guoweichao@oppo.com>; Zhang Shiming<mailto:zhangshiming@oppo.com>; Gao Xiang<mailto:hsiangkao@aol.com>
主题: [WIP] [PATCH 04/12] erofs-utils: fuse: adjust larger extent handling
so more easy to understand.

[ let's fold in to the original patch. ]
Cc: Huang Jianan <huangjianan@oppo.com>
Signed-off-by: Gao Xiang <hsiangkao@aol.com>
---
fuse/read.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/fuse/read.c b/fuse/read.c
index 0d0e3b0fa468..dd44adaa1c40 100644
--- a/fuse/read.c
+++ b/fuse/read.c
@@ -112,12 +112,17 @@ size_t erofs_read_data_compression(struct erofs_vnode *vnode, char *buffer,
Z_EROFS_COMPRESSION_LZ4 :
Z_EROFS_COMPRESSION_SHIFTED;
- if (end >= map.m_la + map.m_llen) {
- count = map.m_llen;
- partial = !(map.m_flags & EROFS_MAP_FULL_MAPPED);
- } else {
+ /*
+ * trim to the needed size if the returned extent is quite
+ * larger than requested, and set up partial flag as well.
+ */
+ if (end < map.m_la + map.m_llen) {
count = end - map.m_la;
partial = true;
+ } else {
+ ASSERT(end == map.m_la + map_m_llen);

I think you mean map.m_llen intesad of map_m_llen.
Besides, I don't understand why add ASSERT here.
I think this condition will be true if offset+size is exactly the end of a compressed block?

+ count = map.m_llen;
+ partial = !(map.m_flags & EROFS_MAP_FULL_MAPPED);
}
if ((off_t)map.m_la < offset) {
--
2.24.0

Thanks,
Jianan


________________________________
OPPO

本电子邮件及其附件含有OPPO公司的保密信息,仅限于邮件指明的收件人使用(包含个人及群组)。禁止任何人在未经授权的情况下以任何形式使用。如果您错收了本邮件,请立即以电子邮件通知发件人并删除本邮件及其附件。

This e-mail and its attachments contain confidential information from OPPO, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!

[-- Attachment #2: Type: text/html, Size: 7286 bytes --]

  reply index

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201017051621.7810-1-hsiangkao.ref@aol.com>
2020-10-17  5:16 ` [WIP] [PATCH 00/12] erofs-utils: introduce fuse implementation Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 01/12] " Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 02/12] erofs-utils: fuse: support read special file Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 03/12] erofs-utils: fuse: support read compressed file Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 04/12] erofs-utils: fuse: adjust larger extent handling Gao Xiang via Linux-erofs
2020-10-19  3:13     ` huangjianan [this message]
2020-10-19  3:32       ` 回复: " Gao Xiang via Linux-erofs
2020-10-19  4:49         ` 回复: " Huang Jianan
2020-10-19  3:37     ` 回复: " Huang Jianan
2020-10-19  3:43       ` Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 05/12] erofs-utils: fuse: use proper expression about inode size Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 06/12] erofs-utils: fuse: drop ofs_out Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 07/12] erofs-utils: fuse: refuse a undefined shifted cluster behavior Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 08/12] erofs-utils: fuse: drop z_erofs_shifted_transform() Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 09/12] erofs-utils: fuse: rename ofs_head and outputsize Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 10/12] erofs-utils: fuse: cleanup erofs_read_data_compression() Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 11/12] erofs-utils: fuse: move up mpage in struct erofs_map_blocks Gao Xiang via Linux-erofs
2020-10-17  5:16   ` [WIP] [PATCH 12/12] erofs-utils: fuse: fix up source headers Gao Xiang via Linux-erofs

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=2020101911134102451012@oppo.com \
    --to=huangjianan@oppo.com \
    --cc=guoweichao@oppo.com \
    --cc=hsiangkao@aol.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=zhangshiming@oppo.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

Linux-EROFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-erofs/0 linux-erofs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-erofs linux-erofs/ https://lore.kernel.org/linux-erofs \
		linux-erofs@lists.ozlabs.org linux-erofs@ozlabs.org
	public-inbox-index linux-erofs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linux-erofs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git