coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto merging extents


From: Pádraig Brady
Subject: Re: auto merging extents
Date: Tue, 05 Apr 2011 20:07:08 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 05/04/11 11:33, Pádraig Brady wrote:
> This improves upon 
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=3ed0384c
> by handling mergeable extents that span fiemap scan boundaries.
> 
> The diff, ignoring whitespace changes, is below.
> The full patch is attached.

Oops I also need to set the pointer to NULL in
extent_scan_free() in the previous patch.
I also noticed a chance of an unlikely leak:

commit bc5579c7b918a54df1d37547bc90319c8d02a84a
Author: Pádraig Brady <address@hidden>
Date:   Tue Apr 5 19:16:40 2011 +0100

    copy: fix an unlikely memory leak when a fiemap copy fails

    * src/copy.c (extent_copy): Free the extents array when
    sparse_copy() fails.

diff --git a/src/copy.c b/src/copy.c
index 05f92b3..c7a8d8e 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -415,7 +415,7 @@ extent_copy (int src_fd, int dest_fd, char *buf, size_t 
buf_size,
                                   sparse_mode == SPARSE_ALWAYS,
                                   src_name, dst_name, ext_len, &n_read,
                                   &wrote_hole_at_eof))
-                return false;
+                goto fail;

               dest_pos = ext_start + n_read;
             }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]