Skip to content
Snippets Groups Projects
  1. Jul 09, 2021
    • Hanna Reitz's avatar
      export/fuse: Give SET_ATTR_SIZE its own branch · 9bad96a8
      Hanna Reitz authored
      
      In order to support changing other attributes than the file size in
      fuse_setattr(), we have to give each its own independent branch.  This
      also applies to the only attribute we do support right now.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20210625142317.271673-4-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      9bad96a8
    • Hanna Reitz's avatar
      export/fuse: Add allow-other option · 8fc54f94
      Hanna Reitz authored
      
      Without the allow_other mount option, no user (not even root) but the
      one who started qemu/the storage daemon can access the export.  Allow
      users to configure the export such that such accesses are possible.
      
      While allow_other is probably what users want, we cannot make it an
      unconditional default, because passing it is only possible (for non-root
      users) if the global fuse.conf configuration file allows it.  Thus, the
      default is an 'auto' mode, in which we first try with allow_other, and
      then fall back to without.
      
      FuseExport.allow_other reports whether allow_other was actually used as
      a mount option or not.  Currently, this information is not used, but a
      future patch will let this field decide whether e.g. an export's UID and
      GID can be changed through chmod.
      
      One notable thing about 'auto' mode is that libfuse may print error
      messages directly to stderr, and so may fusermount (which it executes).
      Our export code cannot really filter or hide them.  Therefore, if 'auto'
      fails its first attempt and has to fall back, fusermount will print an
      error message that mounting with allow_other failed.
      
      This behavior necessitates a change to iotest 308, namely we need to
      filter out this error message (because if the first attempt at mounting
      with allow_other succeeds, there will be no such message).
      
      Furthermore, common.rc's _make_test_img should use allow-other=off for
      FUSE exports, because iotests generally do not need to access images
      from other users, so allow-other=on or allow-other=auto have no
      advantage.  OTOH, allow-other=on will not work on systems where
      user_allow_other is disabled, and with allow-other=auto, we get said
      error message that we would need to filter out again.  Just disabling
      allow-other is simplest.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20210625142317.271673-3-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      8fc54f94
    • Hanna Reitz's avatar
      export/fuse: Pass default_permissions for mount · 2c7dd057
      Hanna Reitz authored
      
      We do not do any permission checks in fuse_open(), so let the kernel do
      them.  We already let fuse_getattr() report the proper UNIX permissions,
      so this should work the way we want.
      
      This causes a change in 308's reference output, because now opening a
      non-writable export with O_RDWR fails already, instead of only actually
      attempting to write to it.  (That is an improvement.)
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20210625142317.271673-2-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      2c7dd057
    • Heinrich Schuchardt's avatar
      util/uri: do not check argument of uri_free() · c2615bdf
      Heinrich Schuchardt authored
      
      uri_free() checks if its argument is NULL in uri_clean() and g_free().
      There is no need to check the argument before the call.
      
      Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Message-Id: <20210629063602.4239-1-xypron.glpk@gmx.de>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      c2615bdf
    • Peter Lieven's avatar
      block/rbd: drop qemu_rbd_refresh_limits · eb06cbab
      Peter Lieven authored
      
      librbd supports 1 byte alignment for all aio operations.
      
      Currently, there is no API call to query limits from the Ceph
      ObjectStore backend.  So drop the bdrv_refresh_limits completely
      until there is such an API call.
      
      Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
      Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Message-Id: <20210702172356.11574-7-idryomov@gmail.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      eb06cbab
    • Peter Lieven's avatar
      block/rbd: add write zeroes support · c56ac27d
      Peter Lieven authored
      This patch wittingly sets BDRV_REQ_NO_FALLBACK and silently ignores
      BDRV_REQ_MAY_UNMAP for older librbd versions.
      
      The rationale for this is as follows (citing Ilya Dryomov current RBD
      maintainer):
      
      ---8<---
      a) remove the BDRV_REQ_MAY_UNMAP check in qemu_rbd_co_pwrite_zeroes()
         and as a consequence always unmap if librbd is too old
      
         It's not clear what qemu's expectation is but in general Write
         Zeroes is allowed to unmap.  The only guarantee is that subsequent
         reads return zeroes, everything else is a hint.  This is how it is
         specified in the kernel and in the NVMe spec.
      
         In particular, block/nvme.c implements it as follows:
      
         if (flags & BDRV_REQ_MAY_UNMAP) {
             cdw12 |= (1 << 25);
         }
      
         This sets the Deallocate bit.  But if it's not set, the device may
         still deallocate:
      
         """
         If the Deallocate bit (CDW12.DEAC) is set to '1' in a Write Zeroes
         command, and the namespace supports clearing all bytes to 0h in the
         values read (e.g., bits 2:0 in the DLFEAT field are set to 001b)
         from a deallocated logical block and its metadata (excluding
         protection information), then for each specified logical block, the
         controller:
         - should deallocate that logical block;
      
         ...
      
         If the Deallocate bit is cleared to '0' in a Write Zeroes command,
         and the namespace supports clearing all bytes to 0h in the values
         read (e.g., bits 2:0 in the DLFEAT field are set to 001b) from
         a deallocated logical block and its metadata (excluding protection
         information), then, for each specified logical block, the
         controller:
         - may deallocate that logical block;
         """
      
         https://nvmexpress.org/wp-content/uploads/NVM-Express-NVM-Command-Set-Specification-2021.06.02-Ratified-1.pdf
      
      
      
      b) set BDRV_REQ_NO_FALLBACK in supported_zero_flags
      
         Again, it's not clear what qemu expects here, but without it we end
         up in a ridiculous situation where specifying the "don't allow slow
         fallback" switch immediately fails all efficient zeroing requests on
         a device where Write Zeroes is always efficient:
      
         $ qemu-io -c 'help write' | grep -- '-[zun]'
          -n, -- with -z, don't allow slow fallback
          -u, -- with -z, allow unmapping
          -z, -- write zeroes using blk_co_pwrite_zeroes
      
         $ qemu-io -f rbd -c 'write -z -u -n 0 1M' rbd:foo/bar
         write failed: Operation not supported
      --->8---
      
      Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
      Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Message-Id: <20210702172356.11574-6-idryomov@gmail.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      c56ac27d
    • Peter Lieven's avatar
      block/rbd: migrate from aio to coroutines · c3e5fac5
      Peter Lieven authored
      
      Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
      Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Message-Id: <20210702172356.11574-5-idryomov@gmail.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      c3e5fac5
    • Peter Lieven's avatar
      block/rbd: update s->image_size in qemu_rbd_getlength · 6d921418
      Peter Lieven authored
      
      While at it just call rbd_get_size and avoid rbd_image_info_t.
      
      Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
      Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Message-Id: <20210702172356.11574-4-idryomov@gmail.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      6d921418
    • Peter Lieven's avatar
      block/rbd: store object_size in BDRVRBDState · 832a93dc
      Peter Lieven authored
      
      Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
      Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Message-Id: <20210702172356.11574-3-idryomov@gmail.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      832a93dc
    • Peter Lieven's avatar
      block/rbd: bump librbd requirement to luminous release · 48672ac0
      Peter Lieven authored
      
      Ceph Luminous (version 12.2.z) is almost 4 years old at this point.
      Bump the requirement to get rid of the ifdef'ry in the code.
      Qemu 6.1 dropped the support for RHEL-7 which was the last supported
      OS that required an older librbd.
      
      Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
      Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Message-Id: <20210702172356.11574-2-idryomov@gmail.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      48672ac0
    • Or Ozeri's avatar
      block/rbd: Add support for rbd image encryption · 42e4ac9e
      Or Ozeri authored
      
      Starting from ceph Pacific, RBD has built-in support for image-level encryption.
      Currently supported formats are LUKS version 1 and 2.
      
      There are 2 new relevant librbd APIs for controlling encryption, both expect an
      open image context:
      
      rbd_encryption_format: formats an image (i.e. writes the LUKS header)
      rbd_encryption_load: loads encryptor/decryptor to the image IO stack
      
      This commit extends the qemu rbd driver API to support the above.
      
      Signed-off-by: default avatarOr Ozeri <oro@il.ibm.com>
      Message-Id: <20210627114635.39326-1-oro@il.ibm.com>
      Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      42e4ac9e
    • Ilya Dryomov's avatar
      MAINTAINERS: update block/rbd.c maintainer · 0725570b
      Ilya Dryomov authored
      
      Jason has moved on from working on RBD and Ceph.  I'm taking over
      his role upstream.
      
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Message-Id: <20210519112513.19694-1-idryomov@gmail.com>
      Acked-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      0725570b
  2. Jul 08, 2021
  3. Jul 07, 2021
  4. Jul 06, 2021
Loading