All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] GFS2: Allocate reservation during write_begin if needed
       [not found] <651143083.14528614.1424192729406.JavaMail.zimbra@redhat.com>
@ 2015-02-17 17:09 ` Bob Peterson
  2015-02-17 19:00   ` Steven Whitehouse
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Peterson @ 2015-02-17 17:09 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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 <rpeterso@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);



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

* [Cluster-devel] [GFS2 PATCH] GFS2: Allocate reservation during write_begin if needed
  2015-02-17 17:09 ` [Cluster-devel] [GFS2 PATCH] GFS2: Allocate reservation during write_begin if needed Bob Peterson
@ 2015-02-17 19:00   ` Steven Whitehouse
  2015-02-17 19:09     ` Bob Peterson
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Whitehouse @ 2015-02-17 19:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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 <rpeterso@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);
>



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

* [Cluster-devel] [GFS2 PATCH] GFS2: Allocate reservation during write_begin if needed
  2015-02-17 19:00   ` Steven Whitehouse
@ 2015-02-17 19:09     ` Bob Peterson
  2015-02-17 19:19       ` Steven Whitehouse
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Peterson @ 2015-02-17 19:09 UTC (permalink / raw)
  To: cluster-devel.redhat.com

----- Original Message -----
> 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.

Hi,

In a normal write, the code goes through gfs2_page_mkwrite or
gfs2_file_aio_write. In the failing scenario, it's going through
sendfile. I suppose I could patch sendfile as an alternative, but
the advantage here is that this patch will do it only if a block
allocation is needed.

Regards,

Bob Peterson
Red Hat File Systems



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

* [Cluster-devel] [GFS2 PATCH] GFS2: Allocate reservation during write_begin if needed
  2015-02-17 19:09     ` Bob Peterson
@ 2015-02-17 19:19       ` Steven Whitehouse
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Whitehouse @ 2015-02-17 19:19 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On 17/02/15 19:09, Bob Peterson wrote:
> ----- Original Message -----
>> 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.
> Hi,
>
> In a normal write, the code goes through gfs2_page_mkwrite or
> gfs2_file_aio_write. In the failing scenario, it's going through
> sendfile. I suppose I could patch sendfile as an alternative, but
> the advantage here is that this patch will do it only if a block
> allocation is needed.
>
> Regards,
>
> Bob Peterson
> Red Hat File Systems

Ah, I see. In which case that code path should be patched. So it should 
be part of the splice code I think, since it should be done at the 
higher level, and not at the write_begin level, since that is too late. 
We should have a call to the reservation code too at that point, to 
ensure that we don't have fragmentation issues. So we need a wrapper for 
|iter_file_splice_write| along the lines of gfs2_file_write_iter I think,

Steve.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20150217/5af83d4a/attachment.htm>

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

end of thread, other threads:[~2015-02-17 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <651143083.14528614.1424192729406.JavaMail.zimbra@redhat.com>
2015-02-17 17:09 ` [Cluster-devel] [GFS2 PATCH] GFS2: Allocate reservation during write_begin if needed Bob Peterson
2015-02-17 19:00   ` Steven Whitehouse
2015-02-17 19:09     ` Bob Peterson
2015-02-17 19:19       ` Steven Whitehouse

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.