Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Kevin Wolf
Am 13.11.2014 um 13:38 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 13.11.2014 um 12:45 hat Max Reitz geschrieben: > >> On 2014-11-13 at 12:40, Kevin Wolf wrote: > >> >Am 13.11.2014 um 00:25 hat Eric Blake geschrieben: > >> >>On 11/12/2014 01:27 PM, Markus Armbruster wrote: >

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Markus Armbruster
Kevin Wolf writes: > Am 13.11.2014 um 12:45 hat Max Reitz geschrieben: >> On 2014-11-13 at 12:40, Kevin Wolf wrote: >> >Am 13.11.2014 um 00:25 hat Eric Blake geschrieben: >> >>On 11/12/2014 01:27 PM, Markus Armbruster wrote: >> >>>+/* in hole, end not yet known */ >> >>>+offs = lseek(s->f

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Max Reitz
On 2014-11-13 at 13:00, Kevin Wolf wrote: Am 13.11.2014 um 12:45 hat Max Reitz geschrieben: On 2014-11-13 at 12:40, Kevin Wolf wrote: Am 13.11.2014 um 00:25 hat Eric Blake geschrieben: On 11/12/2014 01:27 PM, Markus Armbruster wrote: +/* in hole, end not yet known */ +offs = lseek(s->

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Kevin Wolf
Am 13.11.2014 um 12:45 hat Max Reitz geschrieben: > On 2014-11-13 at 12:40, Kevin Wolf wrote: > >Am 13.11.2014 um 00:25 hat Eric Blake geschrieben: > >>On 11/12/2014 01:27 PM, Markus Armbruster wrote: > >>>+/* in hole, end not yet known */ > >>>+offs = lseek(s->fd, start, SEEK_DATA); > >>>+

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Max Reitz
On 2014-11-13 at 12:40, Kevin Wolf wrote: Am 13.11.2014 um 00:25 hat Eric Blake geschrieben: On 11/12/2014 01:27 PM, Markus Armbruster wrote: +/* in hole, end not yet known */ +offs = lseek(s->fd, start, SEEK_DATA); +if (offs < 0) { +/* no idea where the hole ends, give up (

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Kevin Wolf
Am 13.11.2014 um 00:25 hat Eric Blake geschrieben: > On 11/12/2014 01:27 PM, Markus Armbruster wrote: > > +/* in hole, end not yet known */ > > +offs = lseek(s->fd, start, SEEK_DATA); > > +if (offs < 0) { > > +/* no idea where the hole ends, give up (unlikely to happen) */ > > +

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Markus Armbruster
Max Reitz writes: > On 2014-11-12 at 20:27, Markus Armbruster wrote: >> Commit 5500316 (May 2012) implemented raw_co_is_allocated() as >> follows: >> >> 1. If defined(CONFIG_FIEMAP), use the FS_IOC_FIEMAP ioctl >> >> 2. Else if defined(SEEK_HOLE) && defined(SEEK_DATA), use lseek() >> >> 3. Else p

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Markus Armbruster
Eric Blake writes: > On 11/12/2014 01:27 PM, Markus Armbruster wrote: >> Commit 5500316 (May 2012) implemented raw_co_is_allocated() as >> follows: >> > >> Thus, the FIEMAP code executes rarely. Makes it a nice hidey-hole for >> bugs. Worse, bugs hiding there can theoretically bite even on a h

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Max Reitz
On 2014-11-12 at 20:27, Markus Armbruster wrote: Commit 5500316 (May 2012) implemented raw_co_is_allocated() as follows: 1. If defined(CONFIG_FIEMAP), use the FS_IOC_FIEMAP ioctl 2. Else if defined(SEEK_HOLE) && defined(SEEK_DATA), use lseek() 3. Else pretend there are no holes Later on, raw_

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-13 Thread Markus Armbruster
Fam Zheng writes: > On Wed, 11/12 20:27, Markus Armbruster wrote: >> Commit 5500316 (May 2012) implemented raw_co_is_allocated() as >> follows: >> >> 1. If defined(CONFIG_FIEMAP), use the FS_IOC_FIEMAP ioctl >> >> 2. Else if defined(SEEK_HOLE) && defined(SEEK_DATA), use lseek() >> >> 3. Else p

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-12 Thread Eric Blake
On 11/12/2014 01:27 PM, Markus Armbruster wrote: > Commit 5500316 (May 2012) implemented raw_co_is_allocated() as > follows: > > Thus, the FIEMAP code executes rarely. Makes it a nice hidey-hole for > bugs. Worse, bugs hiding there can theoretically bite even on a host > that has SEEK_HOLE/SEEK

Re: [Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-12 Thread Fam Zheng
On Wed, 11/12 20:27, Markus Armbruster wrote: > Commit 5500316 (May 2012) implemented raw_co_is_allocated() as > follows: > > 1. If defined(CONFIG_FIEMAP), use the FS_IOC_FIEMAP ioctl > > 2. Else if defined(SEEK_HOLE) && defined(SEEK_DATA), use lseek() > > 3. Else pretend there are no holes > >

[Qemu-devel] [PATCH 2/2] raw-posix: SEEK_HOLE suffices, get rid of FIEMAP

2014-11-12 Thread Markus Armbruster
Commit 5500316 (May 2012) implemented raw_co_is_allocated() as follows: 1. If defined(CONFIG_FIEMAP), use the FS_IOC_FIEMAP ioctl 2. Else if defined(SEEK_HOLE) && defined(SEEK_DATA), use lseek() 3. Else pretend there are no holes Later on, raw_co_is_allocated() was generalized to raw_co_get_blo