Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccad4e14 authored by Steven Whitehouse's avatar Steven Whitehouse
Browse files

GFS2: Correctly set goal block after allocation



The new goal block should be set to the end of the newly
allocated extent, not the start of it.

Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent b5b24d7a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1346,7 +1346,7 @@ int gfs2_alloc_block(struct gfs2_inode *ip, u64 *bn, unsigned int *n)


	rgd->rd_last_alloc = blk;
	rgd->rd_last_alloc = blk;
	block = rgd->rd_data0 + blk;
	block = rgd->rd_data0 + blk;
	ip->i_goal = block;
	ip->i_goal = block + *n - 1;
	error = gfs2_meta_inode_buffer(ip, &dibh);
	error = gfs2_meta_inode_buffer(ip, &dibh);
	if (error == 0) {
	if (error == 0) {
		struct gfs2_dinode *di = (struct gfs2_dinode *)dibh->b_data;
		struct gfs2_dinode *di = (struct gfs2_dinode *)dibh->b_data;