From mboxrd@z Thu Jan 1 00:00:00 1970 From: Abhi Das Date: Thu, 11 Sep 2014 06:01:01 -0500 Subject: [Cluster-devel] [GFS2 PATCH] GFS2: check and correct zero i_goal Message-ID: <1410433261-43792-1-git-send-email-adas@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit A GFS1->GFS2 converted filesystem can have the ip->i_goal field set to zero for inodes. This incorrect value results in -EBADSLT when the user attempts to allocate blocks to such inodes. This patch assigns the goal block to be the block address of the inode itself, which serves as a reasonable starting point for the allocation logic to find the next available block. Resolves: rhbz#1130684 Signed-off-by: Abhi Das --- fs/gfs2/glops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 2ffc67d..799427b 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -349,6 +349,9 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) ip->i_inode.i_ctime.tv_nsec = be32_to_cpu(str->di_ctime_nsec); ip->i_goal = be64_to_cpu(str->di_goal_meta); + if (!ip->i_goal) /* From a previous gfs2_convert, perhaps */ + ip->i_goal = ip->i_no_addr; + ip->i_generation = be64_to_cpu(str->di_generation); ip->i_diskflags = be32_to_cpu(str->di_flags); -- 1.8.1.4