From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org
Cc: Gao Xiang <hsiangkao@linux.alibaba.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 6/6] erofs: use poison pointer to replace the hard-coded address
Date: Sat, 27 May 2023 04:14:59 +0800 [thread overview]
Message-ID: <20230526201459.128169-7-hsiangkao@linux.alibaba.com> (raw)
In-Reply-To: <20230526201459.128169-1-hsiangkao@linux.alibaba.com>
It's safer and cleaner to replace such hard-coded illegal pointer
with poison pointers.
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
fs/erofs/zdata.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 2ea8e7f08372..83df1954b859 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -91,10 +91,8 @@ struct z_erofs_pcluster {
struct z_erofs_bvec compressed_bvecs[];
};
-/* let's avoid the valid 32-bit kernel addresses */
-
/* the end of a chain of pclusters */
-#define Z_EROFS_PCLUSTER_TAIL ((void *)0x5F0ECAFE)
+#define Z_EROFS_PCLUSTER_TAIL ((void *) 0x700 + POISON_POINTER_DELTA)
#define Z_EROFS_PCLUSTER_NIL (NULL)
struct z_erofs_decompressqueue {
--
2.24.4
next prev parent reply other threads:[~2023-05-26 20:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 20:14 [PATCH 0/6] erofs: random cleanups and fixes Gao Xiang
2023-05-26 20:14 ` [PATCH 1/6] erofs: allocate extra bvec pages directly instead of retrying Gao Xiang
2023-05-26 20:14 ` [PATCH 2/6] erofs: avoid on-stack pagepool directly passed by arguments Gao Xiang
2023-05-26 20:14 ` [PATCH 3/6] erofs: kill hooked chains to avoid loops on deduplicated compressed images Gao Xiang
2023-05-26 20:14 ` [PATCH 4/6] erofs: adapt managed inode operations into folios Gao Xiang
2023-05-26 20:14 ` [PATCH 5/6] erofs: use struct lockref to replace handcrafted approach Gao Xiang
2023-05-29 7:29 ` [PATCH v2 " Gao Xiang
2023-05-29 9:16 ` Yue Hu
2023-05-29 9:25 ` Gao Xiang
2023-05-29 12:37 ` [PATCH v3 " Gao Xiang
2023-05-30 3:59 ` Yue Hu
2023-05-26 20:14 ` Gao Xiang [this message]
2023-05-29 9:50 ` [PATCH 0/6] erofs: random cleanups and fixes Yue Hu
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=20230526201459.128169-7-hsiangkao@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).