A problem about All_squash
by 891873395@qq.com
Hi:
I found a question when we use permission "All_squash". We touched a file, and found that the UID and GID of this file is 4294967294. We did not set anonymous UID and GID. But the UID of nfsnobody is 65534 not 4294967294. 65535 is the 16-bit complement of -2 and 4294967294 is the 32-bit complement. So this is a problem of overflow. We shoud set the defalt value to be 0xFFFE. As the Following:
diff --git a/src/include/nfs_exports.h b/src/include/nfs_exports.h
index abec9d2..d45a939 100644
--- a/src/include/nfs_exports.h
+++ b/src/include/nfs_exports.h
@@ -54,8 +54,8 @@
* Export List structure
*/
#define EXPORT_KEY_SIZE 8
-#define ANON_UID -2
-#define ANON_GID -2
+#define ANON_UID 0xFFFE
+#define ANON_GID 0xFFFE
#define EXPORT_LINESIZE 1024
#define INPUT_SIZE 1024
5 years, 8 months
Change in ...nfs-ganesha[next]: Pull up NSM fix from ntirpc
by Daniel Gryniewicz (GerritHub)
Daniel Gryniewicz has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/449893
Change subject: Pull up NSM fix from ntirpc
......................................................................
Pull up NSM fix from ntirpc
NSM connections were only using UDP, even if TCP was specified. This
meant that if statd was only listening on TCP, it could not be
contacted.
Change-Id: If7c9d7f3a925023c935f0321ba1455463783d2d5
Signed-off-by: Daniel Gryniewicz <dang(a)redhat.com>
---
M src/libntirpc
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/93/449893/1
--
To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/449893
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: If7c9d7f3a925023c935f0321ba1455463783d2d5
Gerrit-Change-Number: 449893
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Gryniewicz <dang(a)redhat.com>
Gerrit-MessageType: newchange
5 years, 9 months
FW: A question about ganesha drc can not be free
by Frank Filz
Forwarding to devel(a)lists.nfs-ganesha.org so others can see also.
Frank
From: 方媛 [mailto:fang_yuan1004@163.com]
Sent: Friday, March 29, 2019 1:46 AM
To: malahal(a)us.ibm.com; ffilzlnx(a)mindspring.com
Cc: yanhuan(a)bwstor.com.cn
Subject: A question about ganesha drc can not be free
I have a question about ganasha drc ref count, can you help me. thank you.
I read the latest ganesha git codes, for the protocol V4.0 case, I find drc ref count will not decrease to 0, so can not been inserted into the tcp_drc_recycle_q, I wonder how to free expired drc?
1. At the begining of the request process, nfs_dupreq_start will call nfs_dupreq_get_drc, either a new drc be allocated or an old drc be reused, the drc.ref is set to 0 at first and then added to 1 as below
/* Avoid double reference of drc,
* setting xp_u2 under DRC_ST_LOCK */
req->rq_xprt->xp_u2 = (void *)drc;
(void)nfs_dupreq_ref_drc(drc); /* xprt ref */
DRC_ST_UNLOCK();
drc->d_u.tcp.recycle_time = 0;
then at the end of the nfs_dupreq_get_drc, drc.ref is added to 2 as below
/* call path ref */
(void)nfs_dupreq_ref_drc(drc);
PTHREAD_MUTEX_unlock(&drc->mtx);
if (drc_check_expired)
drc_free_expired();
2. After finish the request process, drc ref count will not decrease 1. Because I see nfs_dupreq_finish will not decrease ref count every time, just when the drc->size > drc->maxsize, will call nfs_dupreq_put_drc to decrease ref count.
/* conditionally retire entries */
dq_again:
if (drc_should_retire(drc)) { /* if drc->sixe < drc->maxsize, will not call nfs_dupreq_put_drc to decrease the drc ref count */
......
TAILQ_REMOVE(&drc->dupreq_q, ov, fifo_q);
--(drc->size);
/* release dv's ref */
nfs_dupreq_put_drc(drc, DRC_FLAG_LOCKED);
/* drc->mtx gets unlocked in the above call! */
rbtree_x_cached_remove(&drc->xt, t, &ov->rbt_k, ov->hk);
}
so drc ref count will not decrease to 1 forever.
3. Then umount the connection, drc ref count will not decrease to 0,
static enum xprt_stat nfs_rpc_free_user_data(SVCXPRT *xprt)
{
if (xprt->xp_u2) {
nfs_dupreq_put_drc(xprt->xp_u2, DRC_FLAG_RELEASE); /* drc ref count is more then 1 */
xprt->xp_u2 = NULL;
}
return XPRT_DESTROYED;
}
so drc can not insert to the tcp_drc_recycle_q, then how to free expired drc?
I will waiting for your reply, thanks very much.
5 years, 9 months
Client owner collisions
by Sriram Patil
Hi,
The client owner generation logic on knfs client is very simple and tries to differentiate on the basis of NFS version and hostname. Here’s a snippet,
scnprintf(str, len, "Linux NFSv%u.%u %s",
clp->rpc_ops->version, clp->cl_minorversion,
clp->cl_rpcclient->cl_nodename);
clp->cl_owner_id = str;
This causes a problem in ganesha in case there are multiple clients connecting to ganesha with same hostname using same NFS version. When comparing client owners, ganesha only takes the client owner from the NFS client into consideration. But if we consider client owner and client IP address to decide if it is the same client before expiring the state, it will treat them as different clients and avoid unnecessary expiry.
Any thoughts?
Thanks,
Sriram
5 years, 9 months
Change in ...nfs-ganesha[next]: Fix syntax error in ganesha_stats script
by Malahal (GerritHub)
Malahal has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/449781
Change subject: Fix syntax error in ganesha_stats script
......................................................................
Fix syntax error in ganesha_stats script
Print should be a function due to " __future__ import print_function",
so fixed few print statements to functions to avoid syntax failures.
Made some trivial clean up as well.
Change-Id: Idf0cb96b1c1d564c33843a43188ca679ebb7e334
Signed-off-by: Malahal Naineni <mnaineni(a)in.ibm.com>
---
M src/scripts/ganeshactl/ganesha_mgr.py
M src/scripts/ganeshactl/ganesha_stats.py
M src/scripts/ganeshactl/manage_exports.py
3 files changed, 17 insertions(+), 12 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/81/449781/1
--
To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/449781
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Idf0cb96b1c1d564c33843a43188ca679ebb7e334
Gerrit-Change-Number: 449781
Gerrit-PatchSet: 1
Gerrit-Owner: Malahal <malahal(a)gmail.com>
Gerrit-MessageType: newchange
5 years, 9 months