Skip to content
Snippets Groups Projects
  1. Nov 02, 2021
  2. Sep 01, 2021
  3. Aug 09, 2021
  4. Jul 20, 2021
  5. Jul 09, 2021
    • Hanna Reitz's avatar
      export/fuse: Let permissions be adjustable · 6aeeaed2
      Hanna Reitz authored
      
      Allow changing the file mode, UID, and GID through SETATTR.
      
      Without allow_other, UID and GID are not allowed to be changed, because
      it would not make sense.  Also, changing group or others' permissions
      is not allowed either.
      
      For read-only exports, +w cannot be set.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20210625142317.271673-5-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      6aeeaed2
    • 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
  6. May 18, 2021
  7. Mar 19, 2021
  8. Mar 08, 2021
  9. Jan 28, 2021
  10. Dec 11, 2020
    • Hanna Reitz's avatar
      fuse: Implement hole detection through lseek · df4ea709
      Hanna Reitz authored
      
      This is a relatively new feature in libfuse (available since 3.8.0,
      which was released in November 2019), so we have to add a dedicated
      check whether it is available before making use of it.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201027190600.192171-7-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      df4ea709
    • Hanna Reitz's avatar
      fuse: (Partially) implement fallocate() · 4ca37a96
      Hanna Reitz authored
      
      This allows allocating areas after the (old) EOF as part of a growing
      resize, writing zeroes, and discarding.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201027190600.192171-6-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      4ca37a96
    • Hanna Reitz's avatar
      fuse: Allow growable exports · 4fba06d5
      Hanna Reitz authored
      
      These will behave more like normal files in that writes beyond the EOF
      will automatically grow the export size.
      
      As an optimization, keep the RESIZE permission for growable exports so
      we do not have to take it for every post-EOF write.  (This permission is
      not released when the export is destroyed, because at that point the
      BlockBackend is destroyed altogether anyway.)
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201027190600.192171-5-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      4fba06d5
    • Hanna Reitz's avatar
      fuse: Implement standard FUSE operations · 41429e3d
      Hanna Reitz authored
      
      This makes the export actually useful instead of only producing errors
      whenever it is accessed.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201027190600.192171-4-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      41429e3d
    • Hanna Reitz's avatar
      fuse: Allow exporting BDSs via FUSE · 0c9b70d5
      Hanna Reitz authored
      
      block-export-add type=fuse allows mounting block graph nodes via FUSE on
      some existing regular file.  That file should then appears like a raw
      disk image, and accesses to it result in accesses to the exported BDS.
      
      Right now, we only implement the necessary block export functions to set
      it up and shut it down.  We do not implement any access functions, so
      accessing the mount point only results in errors.  This will be
      addressed by a followup patch.
      
      We keep a hash table of exported mount points, because we want to be
      able to detect when users try to use a mount point twice.  This is
      because we invoke stat() to check whether the given mount point is a
      regular file, but if that file is served by ourselves (because it is
      already used as a mount point), then this stat() would have to be served
      by ourselves, too, which is impossible to do while we (as the caller)
      are waiting for it to settle.  Therefore, keep track of mount point
      paths to at least catch the most obvious instances of that problem.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201027190600.192171-3-mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      0c9b70d5
  11. Dec 09, 2020
  12. Dec 08, 2020
  13. Nov 12, 2020
  14. Nov 03, 2020
  15. Oct 23, 2020
  16. Oct 02, 2020
Loading