qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH for-3.0] file-posix: Fix write_zeroes with unmap


From: Nir Soffer
Subject: Re: [Qemu-block] [PATCH for-3.0] file-posix: Fix write_zeroes with unmap on block devices
Date: Thu, 26 Jul 2018 19:54:19 +0300

On Thu, Jul 26, 2018 at 7:41 PM Kevin Wolf <address@hidden> wrote:
... 
> > +#ifdef CONFIG_FALLOCATE_PUNCH_HOLE
> > +    ret = do_fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> > +                       aiocb->aio_offset, aiocb->aio_nbytes);
> > +    if (ret != -ENOTSUP) {
> >
>
> This fails with ENODEV on RHEL 7.5 when fd is a block device.
>
> The manual says:
>
>        ENODEV fd does not refer to a regular file or a directory.  (If fd
> is a pipe or FIFO, a different error results.)

do_fallocate() is a wrapper around fallocate() that handles EINTR and
translates a few errno values (including ENODEV) into a -ENOTSUP return
code.

I missed that, so this looks correct.

Nir 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]