* [Cluster-devel] [RHEL5] Fix size caclulation passed to the gfs2 allocator.
@ 2006-12-07 21:03 Russell Cattelan
2006-12-07 22:58 ` [Cluster-devel] " Rik van Riel
2006-12-07 23:17 ` Eric Sandeen
0 siblings, 2 replies; 3+ messages in thread
From: Russell Cattelan @ 2006-12-07 21:03 UTC (permalink / raw)
To: cluster-devel.redhat.com
Simple fix to the allocator code, that was causing big
problems in terms of performance and space used.
--
Russell Cattelan <cattelan@redhat.com>
-------------- next part --------------
[GFS2]
Fix a size calculation error.
The size was incorrectly being computed as a
negative length and then passed to an
unsigned parameter.
This in turn would cause the allocator to
setup enough indirect blocks to hold
a gigabyte worth of file system blocks for
each file created.
Signed-off-by: Russell Cattelan <cattelan@redhat.com>
Index: linux-2.6.18.noarch/fs/gfs2/ops_address.c
===================================================================
--- linux-2.6.18.noarch.orig/fs/gfs2/ops_address.c 2006-12-07 14:56:21.238160150 -0600
+++ linux-2.6.18.noarch/fs/gfs2/ops_address.c 2006-12-07 14:56:29.006254392 -0600
@@ -370,15 +370,17 @@ static int gfs2_prepare_write(struct fil
loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + from;
loff_t end = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
struct gfs2_alloc *al;
+ unsigned int write_len = to - from;
+
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME|GL_AOP, &ip->i_gh);
error = gfs2_glock_nq_m_atime(1, &ip->i_gh);
if (error)
goto out_uninit;
- gfs2_write_calc_reserv(ip, to - from, &data_blocks, &ind_blocks);
+ gfs2_write_calc_reserv(ip, write_len, &data_blocks, &ind_blocks);
- error = gfs2_write_alloc_required(ip, pos, from - to, &alloc_required);
+ error = gfs2_write_alloc_required(ip, pos, write_len, &alloc_required);
if (error)
goto out_unlock;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] Re: [RHEL5] Fix size caclulation passed to the gfs2 allocator.
2006-12-07 21:03 [Cluster-devel] [RHEL5] Fix size caclulation passed to the gfs2 allocator Russell Cattelan
@ 2006-12-07 22:58 ` Rik van Riel
2006-12-07 23:17 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Rik van Riel @ 2006-12-07 22:58 UTC (permalink / raw)
To: cluster-devel.redhat.com
Russell Cattelan wrote:
> Fix a size calculation error.
> The size was incorrectly being computed as a
> negative length and then passed to an
> unsigned parameter.
>
> This in turn would cause the allocator to
> setup enough indirect blocks to hold
> a gigabyte worth of file system blocks for
> each file created.
GACK, ummm ACK
--
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is. Each group
calls the other unpatriotic.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] Re: [RHEL5] Fix size caclulation passed to the gfs2 allocator.
2006-12-07 21:03 [Cluster-devel] [RHEL5] Fix size caclulation passed to the gfs2 allocator Russell Cattelan
2006-12-07 22:58 ` [Cluster-devel] " Rik van Riel
@ 2006-12-07 23:17 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2006-12-07 23:17 UTC (permalink / raw)
To: cluster-devel.redhat.com
Russell Cattelan wrote:
> Simple fix to the allocator code, that was causing big
> problems in terms of performance and space used.
ACK.
You sure that wasn't "speculative preallocation?" :)
-Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-12-07 23:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-07 21:03 [Cluster-devel] [RHEL5] Fix size caclulation passed to the gfs2 allocator Russell Cattelan
2006-12-07 22:58 ` [Cluster-devel] " Rik van Riel
2006-12-07 23:17 ` Eric Sandeen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.