getting eperm on lseek

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

 



Some code using libcephfs running on Jewel isn't working on master.
After creating a file I receive -EPERM when seeking on the file
immediately after opening it. I would expect the seek to succeed, or
the open to have failed.

Here is the code. The check_zero call after ceph_lseek is getting
permission denied.

#include <cassert>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include "include/cephfs/libcephfs.h"

#define check_zero(ret) do { \
  if (ret) { \
    fprintf(stderr, "error: ret: %d/%s", ret, strerror(-ret)); \
    assert(0); \
    exit(1); \
  } } while (0)

int main(int argc, char **argv)
{
  struct ceph_mount_info *cmount;

  int ret = ceph_create(&cmount, "admin");
  check_zero(ret);

  ceph_conf_read_file(cmount, NULL);
  ceph_conf_parse_env(cmount, NULL);

  ret = ceph_mount(cmount, "/");
  check_zero(ret);

  int fd = ceph_open(cmount, "/hello", O_CREAT|O_RDWR, 0666);
  assert(fd >= 0);

  int64_t lret = ceph_lseek(cmount, fd, 0, SEEK_END);
  check_zero(lret);

  ceph_close(cmount, fd);

  ceph_unmount(cmount);
  ceph_release(cmount);

  return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux