From: Shaya Potter Subject: Re: Does sendfile() copy extended attributes? Date: Mon, 15 Dec 2003 00:59:22 -0500 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <1071467962.13226.53.camel@zaphod> References: <200312142339.30153.theman@josephdwagner.info> <1071466993.13226.46.camel@zaphod> <3FDD4ABA.9050003@pobox.com> <1071467381.13226.49.camel@zaphod> <3FDD4CC1.3040800@pobox.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: "Joseph D. Wagner" , linux-fsdevel@vger.kernel.org Return-path: Received: from opus.cs.columbia.edu ([128.59.20.100]:28032 "EHLO opus.cs.columbia.edu") by vger.kernel.org with ESMTP id S263185AbTLOF7v (ORCPT ); Mon, 15 Dec 2003 00:59:51 -0500 To: Jeff Garzik In-Reply-To: <3FDD4CC1.3040800@pobox.com> List-Id: linux-fsdevel.vger.kernel.org On Mon, 2003-12-15 at 00:55, Jeff Garzik wrote: > Shaya Potter wrote: > > On Mon, 2003-12-15 at 00:46, Jeff Garzik wrote: > > > >>Shaya Potter wrote: > >> > >>>On Sun, 2003-12-14 at 12:39, Joseph D. Wagner wrote: > >>> > >>> > >>>>I want to use sendfile() to completely copy a file so that the copy is an > >>>>EXACT, INDISTINGUISHABLE duplicate of the original. > >>>> > >>>>Hence, I need to know if sendfile() copies the extended attributes in > >>>>addition to the file itself. > >>>> > >>>>While I have your attention, does sendfile() also copy the inode attributes > >>>>(i.e. secure delete, compressed, etc.)? > >>> > >>> > >>>sendfile acting as a sys_copy() is a 2.4 unsupported behavior. It > >>>doesn't work on 2.6. > >> > >> > >>Have you tested this assertion lately? :) > >> > >>AFAIK file-file sendfile(2) was fixed in 2.6. > > > > > > didn't work on test6, haven't tried it since. > > > > Linux zaphod 2.6.0-test6 #1 Sat Oct 4 22:35:19 EDT 2003 i686 GNU/Linux > > spotter@zaphod:~$ touch a > > spotter@zaphod:~$ touch b > > spotter@zaphod:~$ ./a.out a b > > error from sendfile: Invalid argument > > > try it on a non-zero file size, there are special requirements IIRC... no difference spotter@zaphod:~$ dd if=/dev/zero of=a count=1 1+0 records in 1+0 records out 512 bytes transferred in 0.001311 seconds (390543 bytes/sec) spotter@zaphod:~$ ls -l a -rw-r--r-- 1 spotter spotter 512 Dec 15 00:58 a spotter@zaphod:~$ ./a.out a b error from sendfile: Invalid argument spotter@zaphod:~$ dd if=/dev/zero of=b count=1 1+0 records in 1+0 records out 512 bytes transferred in 0.000256 seconds (1999963 bytes/sec) spotter@zaphod:~$ ./a.out a b error from sendfile: Invalid argument