lseek gets bad offset from nfs client with ganesha/gluster which supports SEEK
by Kinglong Mee
The latest ganesha/gluster supports seek according to,
https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-41#section-15.11
From the given sa_offset, find the next data_content4 of type sa_what
in the file. If the server can not find a corresponding sa_what,
then the status will still be NFS4_OK, but sr_eof would be TRUE. If
the server can find the sa_what, then the sr_offset is the start of
that content. If the sa_offset is beyond the end of the file, then
SEEK MUST return NFS4ERR_NXIO.
For a file's filemap as,
Part 1: HOLE 0x0000000000000000 ---> 0x0000000000600000
Part 2: DATA 0x0000000000600000 ---> 0x0000000000700000
Part 3: HOLE 0x0000000000700000 ---> 0x0000000001000000
SEEK(0x700000, SEEK_DATA) gets result (sr_eof:1, sr_offset:0x70000) from ganesha/gluster;
SEEK(0x700000, SEEK_HOLE) gets result (sr_eof:0, sr_offset:0x70000) from ganesha/gluster.
If an application depends the lseek result for data searching, it may enter infinite loop.
while (1) {
next_pos = lseek(fd, cur_pos, seek_type);
if (seek_type == SEEK_DATA) {
seek_type = SEEK_HOLE;
} else {
seek_type = SEEK_DATA;
}
if (next_pos == -1) {
return ;
cur_pos = next_pos;
}
The lseek syscall always gets 0x70000 from nfs client for those two cases,
but, if underlying filesystem is ext4/f2fs, or the nfs server is knfsd,
the lseek(0x700000, SEEK_DATA) gets ENXIO.
I wanna to know,
should I fix the ganesha/gluster as knfsd return ENXIO for the first case?
or should I fix the nfs client to return ENXIO for the first case?
thanks,
Kinglong Mee
4 years, 2 months
Access check issue for RO client.
by gaurav gangalwar
Hi,
For client with ReadOnly access and user with ReadWrite access, Ganesha
returns READ/MODIFY/APPEND allowed on ACCESS call.
Linux kernel NFS returns just READ allowed for same.
I think we need to fix Ganesha’s behaviour, we should return access rights
based on client access check also.
Please check the patch attached to fix the behaviour.
Regards,
Gaurav
6 years
Change in ffilz/nfs-ganesha[next]: Make gtest read and write operations async capable
by GerritHub
From Frank Filz <ffilzlnx(a)mindspring.com>:
Frank Filz has uploaded this change for review. ( https://review.gerrithub.io/431567
Change subject: Make gtest read and write operations async capable
......................................................................
Make gtest read and write operations async capable
gtest is not actually well positioned for async, so we use the new
fsal helper functions fsal_read and fsal_write.
Each test provides a mutex and condition variable.
Change-Id: I3a022b6517f78c2f02dfab258a97f28c7ccea451
Signed-off-by: Frank S. Filz <ffilzlnx(a)mindspring.com>
---
M src/gtest/fsal_api/test_commit2_latency.cc
M src/gtest/fsal_api/test_read2_latency.cc
M src/gtest/fsal_api/test_write2_latency.cc
3 files changed, 251 insertions(+), 83 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/67/431567/1
--
To view, visit https://review.gerrithub.io/431567
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a022b6517f78c2f02dfab258a97f28c7ccea451
Gerrit-Change-Number: 431567
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilzlnx(a)mindspring.com>
6 years, 1 month
Change in ffilz/nfs-ganesha[next]: Make 9P read and write async capable
by GerritHub
From Frank Filz <ffilzlnx(a)mindspring.com>:
Frank Filz has uploaded this change for review. ( https://review.gerrithub.io/431566
Change subject: Make 9P read and write async capable
......................................................................
Make 9P read and write async capable
9P is not actually well positioned for async, so we use the new
fsal helper functions fsal_read and fsal_write.
Each worker thread is given a mutex and condition variable.
Change-Id: I785bf9bd95fd87c78799046ab57400f039829131
Signed-off-by: Frank S. Filz <ffilzlnx(a)mindspring.com>
---
M src/MainNFSD/9p_dispatcher.c
M src/Protocols/9P/9p_read.c
M src/Protocols/9P/9p_write.c
M src/include/9p.h
4 files changed, 43 insertions(+), 76 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/66/431566/1
--
To view, visit https://review.gerrithub.io/431566
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I785bf9bd95fd87c78799046ab57400f039829131
Gerrit-Change-Number: 431566
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilzlnx(a)mindspring.com>
6 years, 1 month
Change in ffilz/nfs-ganesha[next]: fsal_helper functions to synchronize async I/O
by GerritHub
From Frank Filz <ffilzlnx(a)mindspring.com>:
Frank Filz has uploaded this change for review. ( https://review.gerrithub.io/431565
Change subject: fsal_helper functions to synchronize async I/O
......................................................................
fsal_helper functions to synchronize async I/O
Some users of read2 and write2 will not be prepared for async I/O. These
simple helpers make it easy. The caller must provide a mutex and
condition variable to use to synchronize completion.
Change-Id: I91fb3f9507c4a141ade7ec84525cdeba4b3d2cd5
Signed-off-by: Frank S. Filz <ffilzlnx(a)mindspring.com>
---
M src/FSAL/fsal_helper.c
M src/include/fsal.h
2 files changed, 88 insertions(+), 0 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/65/431565/1
--
To view, visit https://review.gerrithub.io/431565
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I91fb3f9507c4a141ade7ec84525cdeba4b3d2cd5
Gerrit-Change-Number: 431565
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilzlnx(a)mindspring.com>
6 years, 1 month
Change in ffilz/nfs-ganesha[next]: FSAL_GLUSTER: Enable readdir_plus option
by GerritHub
From Soumya <skoduri(a)redhat.com>:
Soumya has uploaded this change for review. ( https://review.gerrithub.io/431535
Change subject: FSAL_GLUSTER: Enable readdir_plus option
......................................................................
FSAL_GLUSTER: Enable readdir_plus option
Few issues found in FSAL_GLUSTER with readdir_chunk reload
are fixed. Enable readdir_plus so that it gets enough time
to get tested and uncover any other lurking issues before
we tag RC.
Change-Id: I10e43bde10d172b2cd5a3b972abc0f2545e833b3
Signed-off-by: Soumya Koduri <skoduri(a)redhat.com>
---
M src/FSAL/FSAL_GLUSTER/main.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/35/431535/1
--
To view, visit https://review.gerrithub.io/431535
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I10e43bde10d172b2cd5a3b972abc0f2545e833b3
Gerrit-Change-Number: 431535
Gerrit-PatchSet: 1
Gerrit-Owner: Soumya <skoduri(a)redhat.com>
6 years, 1 month
Change in ffilz/nfs-ganesha[next]: Make nfs3 read and write async capable
by GerritHub
From Frank Filz <ffilzlnx(a)mindspring.com>:
Frank Filz has uploaded this change for review. ( https://review.gerrithub.io/431427
Change subject: Make nfs3 read and write async capable
......................................................................
Make nfs3 read and write async capable
Change-Id: I4b6a912debdc4645789a548d7b625de64fbcbc48
Signed-off-by: Frank S. Filz <ffilzlnx(a)mindspring.com>
---
M src/Protocols/NFS/nfs3_read.c
M src/Protocols/NFS/nfs3_write.c
2 files changed, 195 insertions(+), 62 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/27/431427/1
--
To view, visit https://review.gerrithub.io/431427
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b6a912debdc4645789a548d7b625de64fbcbc48
Gerrit-Change-Number: 431427
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilzlnx(a)mindspring.com>
6 years, 1 month
Change in ffilz/nfs-ganesha[next]: Add checks for client access in NFS user access checks.
by GerritHub
From Gaurav <gaurav.gangalwar(a)gmail.com>:
Gaurav has uploaded this change for review. ( https://review.gerrithub.io/431359
Change subject: Add checks for client access in NFS user access checks.
......................................................................
Add checks for client access in NFS user access checks.
Change-Id: Ie82170401a01c02293283ea2aec4ba47b7e8623e
Signed-off-by: Gaurav B. Gangalwar <gaurav.gangalwar(a)gmail.com>
---
M src/support/nfs_creds.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/59/431359/1
--
To view, visit https://review.gerrithub.io/431359
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie82170401a01c02293283ea2aec4ba47b7e8623e
Gerrit-Change-Number: 431359
Gerrit-PatchSet: 1
Gerrit-Owner: Gaurav <gaurav.gangalwar(a)gmail.com>
6 years, 1 month
Tirpc and PORTMAP for communitarian with rpc.statd
by Suhrud Patankar
Hello All,
I have two questions related to NLM and rpc.statd.
Setup:
Ganesha version: V2.5.0.4
CentOS Linux release 7.5.1804
FSAL – Any
1. By default libntirpc has -DPORTMAP build flag enabled. As I
understand this will use UDP to communicate with rpc.statd. With this
Ganesha fails to monitor the NLM clients and hence lock requests fail.
The call to clnt_tp_ncreate_timed() fails in
clnt_dg_control(CLSET_SVC_ADDR) as addr->len is 16 where as
sizeof(cu->cu_raddr) is 128.
If I disable -DPORTMAP build flag in tirpc, then Ganesha uses “tcp” to
connect to rpc.statd and everything works as expected.
Are we supposed to use “tcp” and disable the -DPORTMAP flag? Why is
this flag enabled by default?
2. Case: rpc.statd service restarts. Ganesha is not restarted.
nsm_connect() is done only once. On failure to connect to rpc.statd,
we don’t retry. This causes the NLM lock request to fail with “No
lock” error.
Is it expected that Ganesha will restart when rpc.statd restarts? I
added a patch to re-call nsm_connect() on failure and it works for me
now.
Is this correct way to handle this?
The patch is as below.
------------------------------
From: Suhrud Patankar <suhrudpatankar(a)gmail.com>
Date: Thu, 11 Oct 2018 00:35:45 -0700
Subject: [PATCH] NFSv3: NLM - Reconnect with statd on failure
Ganesha creates the statd connection context only once.
In case statd service restarts, we fail to monitor new clients.
On failure, destroy the STATD connection and recreate new one.
---
src/Protocols/NLM/nsm.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/Protocols/NLM/nsm.c b/src/Protocols/NLM/nsm.c
index 09909d9..8bb41d7 100644
--- a/src/Protocols/NLM/nsm.c
+++ b/src/Protocols/NLM/nsm.c
@@ -47,6 +47,8 @@ bool nsm_connect(void)
if (nsm_clnt != NULL)
return true;
+ LogFullDebug(COMPONENT_NLM, "Creating new nsm connection ");
+
nsm_clnt = clnt_ncreate("localhost", SM_PROG, SM_VERS, "tcp");
if (CLNT_FAILURE(nsm_clnt)) {
@@ -66,7 +68,7 @@ bool nsm_connect(void)
void nsm_disconnect(void)
{
- if (nsm_count == 0 && nsm_clnt != NULL) {
+ if (nsm_clnt != NULL) {
CLNT_DESTROY(nsm_clnt);
nsm_clnt = NULL;
AUTH_DESTROY(nsm_auth);
@@ -83,6 +85,7 @@ bool nsm_monitor(state_nsm_client_t *host)
enum clnt_stat ret;
char client_ip[SOCK_NAME_MAX];
char server_ip[SOCK_NAME_MAX * 2]; /* space for proxy_ip */
+ bool retry = false;
if (host == NULL)
return true;
@@ -120,7 +123,7 @@ bool nsm_monitor(state_nsm_client_t *host)
LogDebug(COMPONENT_NLM, "Monitor %s", host->ssc_nlm_caller_name);
PTHREAD_MUTEX_lock(&nsm_mutex);
-
+again:
/* create a connection to nsm on the localhost */
if (!nsm_connect()) {
LogCrit(COMPONENT_NLM,
@@ -144,6 +147,20 @@ bool nsm_monitor(state_nsm_client_t *host)
}
if (ret != RPC_SUCCESS) {
+ if (! retry) {
+ /* Handle case when statd restarts.
+ * Need to reconnect with statd
+ */
+ LogFullDebug(COMPONENT_NLM,
+ "Try to reconnect with STATD");
+
+ retry = true;
+ nsm_mon.mon_id.my_id.my_name = NULL;
+ clnt_req_release(cc);
+ nsm_disconnect();
+ goto again;
+ }
+
t = rpc_sperror(&cc->cc_error, "failed");
LogCrit(COMPONENT_NLM,
"Monitor %s SM_MON %s",
--
1.7.1
Thanks & Regards,
Suhrud
6 years, 1 month
Change in ffilz/nfs-ganesha[next]: FSAL_GLUSTER: fix memory leak of acl_t
by GerritHub
From Kinglong Mee <kinglongmee(a)gmail.com>:
Kinglong Mee has uploaded this change for review. ( https://review.gerrithub.io/431285
Change subject: FSAL_GLUSTER: fix memory leak of acl_t
......................................................................
FSAL_GLUSTER: fix memory leak of acl_t
Change-Id: I00c8a87e72af7a495e56b9e7ed6f4f98c05e249a
Signed-off-by: Kinglong Mee <mijinlong(a)open-fs.com>
Signed-off-by: Kinglong Mee <kinglongmee(a)gmail.com>
---
M src/FSAL/FSAL_GLUSTER/gluster_internal.h
M src/FSAL/FSAL_GLUSTER/handle.c
2 files changed, 16 insertions(+), 2 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/85/431285/1
--
To view, visit https://review.gerrithub.io/431285
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I00c8a87e72af7a495e56b9e7ed6f4f98c05e249a
Gerrit-Change-Number: 431285
Gerrit-PatchSet: 1
Gerrit-Owner: Kinglong Mee <kinglongmee(a)gmail.com>
6 years, 1 month