Re: [Cluster-devel] [PATCH] gfs2: gfs2_read_sb: put gfs2_assert inside the loop

2020-10-05 Thread Fox Chen
On Mon, Oct 5, 2020 at 9:23 PM Andrew Price wrote: > > On 03/10/2020 07:31, Fox Chen wrote: > > for (x = 2;; x++) { > > ... > > gfs2_assert(sdp, x <= GFS2_MAX_META_HEIGHT); <--- after > > ... > > if (d != sdp->sd_heightsize[x - 1] || m) > >

Re: [Cluster-devel] [PATCH] gfs2: gfs2_read_sb: put gfs2_assert inside the loop

2020-10-05 Thread Andrew Price
On 03/10/2020 07:31, Fox Chen wrote: for (x = 2;; x++) { ... gfs2_assert(sdp, x <= GFS2_MAX_META_HEIGHT); <--- after ... if (d != sdp->sd_heightsize[x - 1] || m) break; sdp->sd_heightsize[x] = space; } sdp->sd_max_height = x

Re: [PATCH] gfs2: gfs2_read_sb: put gfs2_assert inside the loop

2020-10-05 Thread Andreas Gruenbacher
Hi Fox Chen, On Sat, Oct 3, 2020 at 8:33 AM Fox Chen wrote: > Before this patch, gfs2_assert is put outside of the loop of > sdp->sd_heightsize[x] calculation. When something goes wrong, > x exceeds the size of GFS2_MAX_META_HEIGHT, it may already crash inside > the loop when > >

[PATCH] gfs2: gfs2_read_sb: put gfs2_assert inside the loop

2020-10-03 Thread Fox Chen
for (x = 2;; x++) { ... gfs2_assert(sdp, x <= GFS2_MAX_META_HEIGHT); <--- after ... if (d != sdp->sd_heightsize[x - 1] || m) break; sdp->sd_heightsize[x] = space; } sdp->sd_max_height = x gfs2_assert(sdp, sdp->sd_max_height <=