Abhi Das 00a158be83 GFS2: fix bad inode i_goal values during block allocation
This patch checks if i_goal is either zero or if doesn't exist
within any rgrp (i.e gfs2_blk2rgrpd() returns NULL). If so, it
assigns the ip->i_no_addr block as the i_goal.

There are two scenarios where a bad i_goal can result in a
-EBADSLT error.

1. Attempting to allocate to an existing inode:
Control reaches gfs2_inplace_reserve() and ip->i_goal is bad.
We need to fix i_goal here.

2. A new inode is created in a directory whose i_goal is hosed:
In this case, the parent dir's i_goal is copied onto the new
inode. Since the new inode is not yet created, the ip->i_no_addr
field is invalid and so, the fix in gfs2_inplace_reserve() as per
1) won't work in this scenario. We need to catch and fix it sooner
in the parent dir itself (gfs2_create_inode()), before it is
copied to the new inode.

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2014-09-19 10:45:18 +01:00
..
2014-03-19 15:53:52 +00:00
2014-03-19 15:16:24 +00:00
2014-08-21 10:22:23 +01:00
2014-03-03 13:50:12 +00:00
2013-09-05 16:23:51 -04:00
2014-03-07 09:30:51 +00:00
2014-01-06 12:49:43 +00:00
2013-06-29 12:57:05 +04:00
2008-06-27 09:39:44 +01:00
2014-05-14 10:04:34 +01:00
2014-09-11 10:59:56 +01:00
2013-06-14 11:17:15 +01:00
2013-06-03 14:20:18 -07:00
2014-05-14 10:04:34 +01:00
2014-05-14 10:04:34 +01:00
2014-03-07 09:30:51 +00:00
2011-05-10 13:12:49 +01:00
2014-05-14 10:04:34 +01:00
2013-01-29 10:29:05 +00:00
2012-01-11 09:23:05 +00:00
2014-05-14 10:04:34 +01:00
2009-12-16 12:16:49 -05:00