cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] GFS2: Reserve journal space for quota change in do_grow
       [not found] <1979146688.95644942.1372351274028.JavaMail.root@redhat.com>
@ 2013-06-27 16:47 ` Bob Peterson
  2013-06-27 17:43   ` Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2013-06-27 16:47 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

If a GFS2 file system is mounted with quotas and a file is grown
in such a way that its free blocks for the allocation are represented
in a secondary bitmap, GFS2 ran out of blocks in the transaction.
That resulted in "fatal: assertion "tr->tr_num_buf <= tr->tr_blocks".
This patch reserves extra blocks for the quota change so the
transaction has enough space.

Regards,

Bob Peterson
Red Hat File Systems

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

diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 93b5809..5e2f56f 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1232,7 +1232,9 @@ static int do_grow(struct inode *inode, u64 size)
 		unstuff = 1;
 	}
 
-	error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT, 0);
+	error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT +
+				 (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF ?
+				  0 : RES_QUOTA), 0);
 	if (error)
 		goto do_grow_release;
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [GFS2 PATCH] GFS2: Reserve journal space for quota change in do_grow
  2013-06-27 16:47 ` [Cluster-devel] [GFS2 PATCH] GFS2: Reserve journal space for quota change in do_grow Bob Peterson
@ 2013-06-27 17:43   ` Steven Whitehouse
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2013-06-27 17:43 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Thanks - now in the -nmw git tree,

Steve.

On Thu, 2013-06-27 at 12:47 -0400, Bob Peterson wrote:
> Hi,
> 
> If a GFS2 file system is mounted with quotas and a file is grown
> in such a way that its free blocks for the allocation are represented
> in a secondary bitmap, GFS2 ran out of blocks in the transaction.
> That resulted in "fatal: assertion "tr->tr_num_buf <= tr->tr_blocks".
> This patch reserves extra blocks for the quota change so the
> transaction has enough space.
> 
> Regards,
> 
> Bob Peterson
> Red Hat File Systems
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
> ---
>  fs/gfs2/bmap.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
> index 93b5809..5e2f56f 100644
> --- a/fs/gfs2/bmap.c
> +++ b/fs/gfs2/bmap.c
> @@ -1232,7 +1232,9 @@ static int do_grow(struct inode *inode, u64 size)
>  		unstuff = 1;
>  	}
>  
> -	error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT, 0);
> +	error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT +
> +				 (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF ?
> +				  0 : RES_QUOTA), 0);
>  	if (error)
>  		goto do_grow_release;
>  
> 




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-27 17:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1979146688.95644942.1372351274028.JavaMail.root@redhat.com>
2013-06-27 16:47 ` [Cluster-devel] [GFS2 PATCH] GFS2: Reserve journal space for quota change in do_grow Bob Peterson
2013-06-27 17:43   ` Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).