Thread (13 messages) 13 messages, 7 authors, 2011-09-19

Re: [PATCH 1/7] BTRFS: Fix lseek return value for error

From: Jeff liu <hidden>
Date: 2011-09-18 10:33:38
Also in: linux-fsdevel, lkml

=D4=DA 2011-9-18=A3=AC=CF=C2=CE=E74:42=A3=AC Marco Stornelli =D0=B4=B5=C0=
=A3=BA
Il 18/09/2011 09:29, Jeff Liu ha scritto:
quoted
Hi Andreas and Andi,
=20
Thanks for your comments.
=20
On 09/18/2011 09:46 AM, Andi Kleen wrote:
=20
quoted
quoted
quoted
with an additional improvement if the offset is larger or equal t=
o the
quoted
quoted
quoted
quoted
file size, return -ENXIO in directly:
=20
               if (offset>=3D inode->i_size) {
                       mutex_unlock(&inode->i_mutex);
                       return -ENXIO;
               }
=20
Except that is wrong, because it would then be impossible to write=
 sparse files.
quoted
=20
Per my tryout, except that, if the offset>=3D source file size, call
lseek(fd, offset, SEEK_DATA/SEEK_HOLE) against Btrfs will always ret=
urn
quoted
the total file size rather than -ENXIO.  however, our desired result=
 it
quoted
-ENXIO in this case, Am I right?
=20
=20
Yes, ENXIO should be the operation result.
Thanks for your kind confirmation.


-Jeff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help