summaryrefslogtreecommitdiffstats
path: root/lib/scatterlist.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-06-29 08:48:06 -0600
committerJens Axboe <axboe@kernel.dk>2018-06-29 08:48:06 -0600
commit9544bc5347207a68eb308cc8aaaed6c3a687cabd (patch)
tree94a63c95fc1841e67aeddc0ddc9ab1872facc8ba /lib/scatterlist.c
parent49f1c61071f528ebda699ea59ab87aec3df79d4e (diff)
downloadlinux-stable-9544bc5347207a68eb308cc8aaaed6c3a687cabd.tar.gz
linux-stable-9544bc5347207a68eb308cc8aaaed6c3a687cabd.tar.bz2
linux-stable-9544bc5347207a68eb308cc8aaaed6c3a687cabd.zip
sg: remove ->sg_magic member
This was introduced more than a decade ago when sg chaining was added, but we never really caught anything with it. The scatterlist entry size can be critical, since drivers allocate it, so remove the magic member. Recently it's been triggering allocation stalls and failures in NVMe. Tested-by: Jordan Glover <Golden_Miller83@protonmail.ch> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib/scatterlist.c')
-rw-r--r--lib/scatterlist.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 06dad7a072fd..d4ae67d6cd1e 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -24,9 +24,6 @@
**/
struct scatterlist *sg_next(struct scatterlist *sg)
{
-#ifdef CONFIG_DEBUG_SG
- BUG_ON(sg->sg_magic != SG_MAGIC);
-#endif
if (sg_is_last(sg))
return NULL;
@@ -111,10 +108,7 @@ struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents)
for_each_sg(sgl, sg, nents, i)
ret = sg;
-#ifdef CONFIG_DEBUG_SG
- BUG_ON(sgl[0].sg_magic != SG_MAGIC);
BUG_ON(!sg_is_last(ret));
-#endif
return ret;
}
EXPORT_SYMBOL(sg_last);