xfs
[Top] [All Lists]

Re: [PATCH 2/3] xfs: Add support IOC_MOV_DATA ioctl

To: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
Subject: Re: [PATCH 2/3] xfs: Add support IOC_MOV_DATA ioctl
From: Theodore Ts'o <tytso@xxxxxxx>
Date: Mon, 14 Jul 2014 17:25:39 -0400
Cc: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>, 'Christoph Hellwig' <hch@xxxxxxxxxxxxx>, 'Dave Chinner' <david@xxxxxxxxxxxxx>, 'linux-ext4' <linux-ext4@xxxxxxxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, 'Luk?? Czerner' <lczerner@xxxxxxxxxx>, 'Brian Foster' <bfoster@xxxxxxxxxx>, 'Ashish Sangwan' <a.sangwan@xxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=xGAAIRP3n6K8DtNM6AVGJUVjbZHBm0GWgTdk7bDDblc=; b=iCkCt52azApDyo0W2WCCxhb4iyZ8eHTXMGUpngnk180q4sQYnIz8LPQ/LD+PIja8CZvgAWO/xFPYkBMuB6VADE5ew1E4wsECebGRUBVrdneZDNCc2cisQNS8iPqYY+lMngnQo9kmCJBfXquhZRWwYhZ0xFHe75VdsEQ8XTgEboU=;
In-reply-to: <87ha2jsy6p.fsf@xxxxxxxxxx>
Mail-followup-to: Theodore Ts'o <tytso@xxxxxxx>, Dmitry Monakhov <dmonakhov@xxxxxxxxxx>, Namjae Jeon <namjae.jeon@xxxxxxxxxxx>, 'Christoph Hellwig' <hch@xxxxxxxxxxxxx>, 'Dave Chinner' <david@xxxxxxxxxxxxx>, 'linux-ext4' <linux-ext4@xxxxxxxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, 'Luk?? Czerner' <lczerner@xxxxxxxxxx>, 'Brian Foster' <bfoster@xxxxxxxxxx>, 'Ashish Sangwan' <a.sangwan@xxxxxxxxxxx>, xfs@xxxxxxxxxxx
References: <003f01cf9aa4$1e9e5240$5bdaf6c0$@samsung.com> <20140708121500.GA518@xxxxxxxxxxxxx> <001801cf9b3f$ad786ff0$08694fd0$@samsung.com> <87ha2jsy6p.fsf@xxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Mon, Jul 14, 2014 at 08:27:26PM +0400, Dmitry Monakhov wrote:
> Actually they are differ. EXT4_IOC_MOVE_EXT copy data inside kernel,
> but XFS_IOC_SWAPEXT live this job to userpsace see:
> http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsprogs.git;a=blob;f=fsr/xfs_fsr.c
>  packfile
> And I'll vote to make EXT4_IOC_MOVE_EXT deprecated, and implement 
> EXT4_IOC_SWAPEXT
> as XFS does that.
> Ted, Lukas what do you think about that?

The reason why EXT4_IOC_MOVE_EXT moves the data via the cache is to
avoid being subject to races if the file happens to mmap'ed and being
actively modified at the time of the defrag operation.  

I'm not sure how XFS handles that case, but if it's not somehow
locking the file against mmap's before it starts the userspace copy,
it would seem to me to be fairly dangerous in terms of prevent
potential data loss in this scenario.  Unless they are doing some
especially clever?

Regards,

                                                - Ted

<Prev in Thread] Current Thread [Next in Thread>