Hi,

This patch adds a call to function gfs2_rs_alloc to make sure a
reservation structure has been allocated before attempting to
reserve blocks.

Regards,

Bob Peterson
Red Hat File Systems

Signed-off-by: Bob Peterson <rpete...@redhat.com> 
---
 fs/gfs2/aops.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 805b37f..6453e23 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -675,6 +675,9 @@ static int gfs2_write_begin(struct file *file, struct 
address_space *mapping,
                if (error)
                        goto out_unlock;
 
+               error = gfs2_rs_alloc(ip);
+               if (error)
+                       goto out_qunlock;
                requested = data_blocks + ind_blocks;
                ap.target = requested;
                error = gfs2_inplace_reserve(ip, &ap);

Reply via email to