[Nfs-ganesha-devel] read-only open causing file to be truncated with NFSv4/ganesha.

2018-10-12 Thread Pradeep
This list has been deprecated. Please subscribe to the new devel list at 
lists.nfs-ganesha.org.Hello,

I'm seeing an issue with a specific application flow and with ganesha
server (2.6.5). Here is what the application does:

- fd1 = open (file1, O_WRONLY|O_CREAT|O_TRUNC)
  Ganesha creates a state and stores the flags in fd->openflags (see
vfs_open2())
- write (fd1, )
- fd2 = open(file1, O_RDONLY)
  Ganesha finds the state for the first open, finds the flags and calls
fsal_reopen2() with old and new flags OR'd together. This causes the file
to be truncated because the original open was done with O_TRUNC.

I don't see this behavior with kernel NFS or a local filesystem. Any
suggestions on fixing this? Here is a quick and dirty program to reproduce
it - you can see that the second stat prints zero as size with a mount from
Ganesha server.

#include 
#include 
#include 
#include 
#include 
#include 
#include 

int main(int argc, char **argv)
{
  char *fn = argv[1];
  int fd;
  char buf[1024];
  struct stat stbuf;
  int rc;


  fd = open(fn, O_WRONLY|O_CREAT|O_TRUNC, 0666);
  printf("open(%s) = %d\n", fn, fd);

  ssize_t ret;
  ret = write(fd, buf, sizeof(buf));
  printf("write returned %ld\n", ret);

  rc = stat(fn, );
  printf("size: %ld\n", stbuf.st_size);

  int fd1;
  fd1 = open(fn, O_RDONLY);
  printf("open(%s) = %d\n", fn, fd1);

  rc = stat(fn, );
  printf("size: %ld\n", stbuf.st_size);
}

Thanks,
Pradeep
___
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel


[Nfs-ganesha-devel] Announce Push of V2.8-dev.1

2018-10-12 Thread Frank Filz
This list has been deprecated. Please subscribe to the new devel list at 
lists.nfs-ganesha.org.Branch next

 

Tag:V2.8-dev.1

 

Release Highlights

 

* V4.2 security labels

 

* V4.2 ALLOCATE and SEEK for FSAL_VFS

 

* Sticky grace period

 

* Allow exports to be referral points in FSAL_VFS

 

* get_nodeid recovery backend op

 

* FSAL_CEPH: kill off old session before the mount

 

* Put NFSv4 Tag into compound_data_t so it can be used in log messages

 

Signed-off-by: Frank S. Filz 

 

Contents:

 

b9a7850 Frank S. Filz V2.8-dev.1

40e64f8 Frank S. Filz FSAL_VFS: Implement fallocate method for ALLOCATE and
DEALLOCATE ops

6bcc884 Frank S. Filz FSAL_VFS: Add seek2 method

4e62939 Frank S. Filz Put NFSv4 Tag into compound_data_t so it can be used
in log messages

faa9745 Sriram Patil Allow exports to be referral points in FSAL_VFS

8c13ae9 Jeff Layton FSAL_CEPH: kill off old session before the mount

6127871 Jeff Layton rados_cluster: implement get_nodeid recovery backend op

5492165 Jeff Layton SAL: add a new get_nodeid recovery backend operation

66c766a Jeff Layton SAL: convert current_grace to struct timespec

cd8263f Jeff Layton NLM: convert nlm4_Test to sticky grace periods

f3d11ec Jeff Layton NLM: convert nlm4_Share to sticky grace periods

0ae6687 Jeff Layton NLM: convert nlm4_Lock to sticky grace periods

02c0cae Jeff Layton NLM: convert nlm_Cancel to sticky grace periods

bfc6921 Jeff Layton NFS: convert nfs4_op_removexattr to sticky grace periods

2778672 Jeff Layton NFS: convert nfs4_op_setxattr to sticky grace periods

d6994e7 Jeff Layton NFS: convert nfs4_op_setattr to sticky grace periods

24a6315 Jeff Layton NFS: convert nfs4_op_rename to sticky grace periods

eac2cab Jeff Layton NFS: convert nfs4_op_remove to sticky grace periods

688731d Jeff Layton NFS: don't check for grace period in
nfs4_check_deleg_reclaim

7a80e65 Jeff Layton NFS: convert open code to use sticky grace periods

8c3b236 Jeff Layton NFSv4: convert nfs4_op_lockt to sticky grace period

050c726 Jeff Layton NFSv4: convert nfs4_op_lock to sticky grace period

fcfce95 Jeff Layton NFS: convert nfs3_setattr to sticky grace period

99affe7 Jeff Layton 9p: take a sticky grace reference for lock ops

0155e67 Jeff Layton SAL: sticky grace periods

d9bb095 Jeff Layton FSAL_CEPH: add support for security labels

1aca402 Jeff Layton FSAL_CEPH: add wrapper functions for xattrs

f995e3c Jeff Layton NFS: add the security label to struct attrlist

68d4292 Jeff Layton RPC: add types and encoder/decoder for security labels

___
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel


[Nfs-ganesha-devel] Announce Push of V2.7.1

2018-10-12 Thread Frank Filz
This list has been deprecated. Please subscribe to the new devel list at 
lists.nfs-ganesha.org.Branch next

 

Tag:V2.7.1

 

Release Highlights

 

* Some doc and config cleanup

 

* two packaging/build fixes

 

* some compiler error/warning fixes

 

Signed-off-by: Frank S. Filz 

 

Contents:

 

af26bf4 Frank S. Filz V2.7.1

a7911fc Kaleb S. KEITHLEY selinux: add nfs-ganesha-selinux subpackage

c607e43 Daniel Gryniewicz Fix uninitialized use compile error

2bf45bb Kinglong Mee nfs_main: fix uninitialised log_path and dump_trace

366d045 Jeff Layton tools: make sure ganesha-rados-grace is installed if
built

76955c3 Jeff Layton config_samples: update the ceph.conf example config

4a34f1b Jeff Layton doc: clean up ganesha-rados-grace document

___
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel