From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Date: Tue, 17 Feb 2015 19:00:25 +0000 Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Allocate reservation during write_begin if needed In-Reply-To: <1649964129.14531060.1424192978271.JavaMail.zimbra@redhat.com> References: <1649964129.14531060.1424192978271.JavaMail.zimbra@redhat.com> Message-ID: <54E38FC9.2020709@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Since we set the allocation structure when the write call begins, and it is not deallocated until there are no writers left with the file open, how does this happen? Steve. On 17/02/15 17:09, Bob Peterson wrote: > 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 > --- > 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); >