Commit Graph

20 Commits (c5d022b638ad521c6e71f36127b894c9d6e4afd1)

Author SHA1 Message Date
Volker Lendecke dfca3e447d Replace explicit memset by calloc
Signed-off-by: Volker Lendecke <vl@samba.org>
2019-03-11 11:25:37 +10:00
Ronnie Sahlberg f141b31c59 Fix memory leak in nfs_close for NFSv3
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2019-02-13 07:38:04 +10:00
Ronnie Sahlberg 38b62bcf87 nfsv3: skip commit if the file has not changed
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2019-01-05 06:53:33 +10:00
Ronnie Sahlberg 9e63589591 add nfs_umount() which will unregister the client from the mount daemon
This is only implemented for v3 since there is no mount protocol in v4.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-12-29 13:56:29 +10:00
Ronnie Sahlberg 48a559cb47 Add nfs_statvfs64()
Add a new function nfs_statvfs64() that returns a struct nfs_statvfs_64
where all fields are uint64_t.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-12-26 13:33:38 +10:00
Ronnie Sahlberg 9edb1078e6
Merge pull request #249 from shreyassiravara/nfs_opendir_cb_bug
nfs_opendir_cb should not queue a READDIR on error
2018-04-29 10:28:23 +10:00
Ronnie Sahlberg 63ba842be9
Merge pull request #252 from shreyassiravara/nfs-pagecache-export
Add & export a call to initialize the pagecache
2018-04-29 10:26:31 +10:00
Shreyas Siravara 1fff7707f2 Add & export a call to initialize the pagecache 2018-04-26 18:15:02 -07:00
Shreyas Siravara df72323c46 nfs_opendir_cb should not queue a READDIR on error
Explanation of the bug:
- nfs_opendir_cb() queues a READDIR when it receives RPC_STATUS_ERROR.
- rpc_purge_all_pdus() explicitly says that no further pdus should be
  queued when rpc_purge_all_pdus() is invoked and the outqueue is being
  cleared.
- Since nfs_opendir_cb() is called in rpc_purge_all_pdus() with
  status=RPC_STATUS_ERROR, this invariant is broken.

Fix:
- Invoke check_nfs3_error() which will invoke the appropriate
  callback with the right error.
- Disallow queueing a request in the if block
2018-04-23 12:33:29 -07:00
Shreyas Siravara 486b74f647 Avoid underflow in readahead when offset < NFS_BLKSIZE 2018-04-23 12:27:09 -07:00
Daniel Abrecht b3fd3ca7e4 Move win32/win32_compat.h to include/win32/win32_compat.h 2018-04-16 19:42:38 +00:00
Ronnie Sahlberg b54fc96e00 Add nfsport/mountport arguments
Add two arguments to set which port to use for MOUNT (only used in NFSv3)
as well as for the NFS protocols.
When set to non-zero libnfs will connect directly to that port and bypass
the use of portmapper completely.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-04-08 14:36:37 +10:00
Ronnie Sahlberg 086c2ec138 improve error strings for rpc_connect_program_async() failures.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-02-01 13:28:05 +10:00
Ronnie Sahlberg 3ba2a2c1fd NFSv3: Fix compiler warning
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-09-05 19:18:07 +10:00
Ronnie Sahlberg ebc2f0a6c2 NFSv3: Add support for open(O_CREAT)
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-25 18:55:25 +10:00
Ronnie Sahlberg bd95371005 NFSv4: Add support for mknod()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-15 20:05:47 +10:00
Ronnie Sahlberg 0ce4917afd nfs_open2(): Add a new nfs_open2() function that takes a mode argument.
Pass mode all the way down to nfs*_open_async() but we do not yet have any
plumbing to actually use it. That will come later as we implement O_CREAT
support.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-06 16:02:39 +10:00
Ronnie Sahlberg 3ced39f567 Rework the NFSv4 path lookup framework so it handles symlinks properly.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-13 18:22:27 +10:00
Ronnie Sahlberg 2b764fa926 NFSv4: Add support for nfs_stat64()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-08 07:41:11 +10:00
Ronnie Sahlberg 56194deeee NFS4: Add support to nfs_mount()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-06 10:04:17 +10:00