From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dongsu Park Subject: Re: [PATCH v5 3/10] ext4: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate Date: Wed, 19 Feb 2014 22:58:05 +0100 Message-ID: <20140219215805.GA1714@gmail.com> References: <1392741489-20097-1-git-send-email-linkinjeon@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: tytso@mit.edu, Namjae Jeon , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, bpm@sgi.com, adilger.kernel@dilger.ca, viro@zeniv.linux.org.uk, Ashish Sangwan , lczerner@redhat.com, linux-fsdevel@vger.kernel.org, jack@suse.cz, linux-ext4@vger.kernel.org, mtk.manpages@gmail.com To: Namjae Jeon Return-path: Content-Disposition: inline In-Reply-To: <1392741489-20097-1-git-send-email-linkinjeon@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com List-Id: linux-ext4.vger.kernel.org Hi Namjae, see below: On 19.02.2014 01:38, Namjae Jeon wrote: > This patch implements fallocate's FALLOC_FL_COLLAPSE_RANGE for Ext4. ...... > + /* > + * Don't start shifting extents until we make sure the hole is big > + * enough to accomodate the shift. > + */ > + path = ext4_ext_find_extent(inode, start - 1, NULL, 0); > + depth = path->p_depth; > + extent = path[depth].p_ext; > + ex_start = extent->ee_block; > + ex_end = extent->ee_block + ext4_ext_get_actual_len(extent); > + ext4_ext_drop_refs(path); > + kfree(path); > + > + if ((start == ex_start && shift > ex_start) || > + (shift > start - ex_end)) { This line causes a compile error. So the fix would be like that: - (shift > start - ex_end)) { + (shift > start - ex_end)) > + return -EINVAL; > + > + /* Its safe to start updating extents */ ...... Apart from that, the whole patchset seems to work without error, both on xfs and on ext4. Of course I had to remove Lukas' patches before testing collapse-range. So it would be excellent if two patch series could get somehow merged. Tested-by: Dongsu Park Regards, Dongsu _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754613AbaBSV6T (ORCPT ); Wed, 19 Feb 2014 16:58:19 -0500 Received: from mail-ig0-f173.google.com ([209.85.213.173]:34140 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754428AbaBSV6O (ORCPT ); Wed, 19 Feb 2014 16:58:14 -0500 Date: Wed, 19 Feb 2014 22:58:05 +0100 From: Dongsu Park To: Namjae Jeon Cc: viro@zeniv.linux.org.uk, david@fromorbit.com, bpm@sgi.com, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, mtk.manpages@gmail.com, lczerner@redhat.com, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Namjae Jeon , Ashish Sangwan Subject: Re: [PATCH v5 3/10] ext4: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate Message-ID: <20140219215805.GA1714@gmail.com> References: <1392741489-20097-1-git-send-email-linkinjeon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1392741489-20097-1-git-send-email-linkinjeon@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Namjae, see below: On 19.02.2014 01:38, Namjae Jeon wrote: > This patch implements fallocate's FALLOC_FL_COLLAPSE_RANGE for Ext4. ...... > + /* > + * Don't start shifting extents until we make sure the hole is big > + * enough to accomodate the shift. > + */ > + path = ext4_ext_find_extent(inode, start - 1, NULL, 0); > + depth = path->p_depth; > + extent = path[depth].p_ext; > + ex_start = extent->ee_block; > + ex_end = extent->ee_block + ext4_ext_get_actual_len(extent); > + ext4_ext_drop_refs(path); > + kfree(path); > + > + if ((start == ex_start && shift > ex_start) || > + (shift > start - ex_end)) { This line causes a compile error. So the fix would be like that: - (shift > start - ex_end)) { + (shift > start - ex_end)) > + return -EINVAL; > + > + /* Its safe to start updating extents */ ...... Apart from that, the whole patchset seems to work without error, both on xfs and on ext4. Of course I had to remove Lukas' patches before testing collapse-range. So it would be excellent if two patch series could get somehow merged. Tested-by: Dongsu Park Regards, Dongsu