Dilger, Andreas | 23 May 2013 01:06
Picon
Favicon

[PATCH] nfs: support 64-bit root inode number in NFS FSID

When exporting a filesystem via NFS, it can generate several kinds
of NFS filesystem IDs. For most of cases, it uses a 32-bit inode
number in the NFS FSID, but this does not work on a filesystem
using a 64-bit root inode number.

In kernel space, NFS can generate/use NFS FSID with a 64-bit inode
number for the "FSID_UUID16_INUM" type. Unfortunately, while the
user space nfs-utils decode the 64-bit inode number from the FSID
correctly, it is truncated when storing it in "struct parsed_fsid".
Expand the "struct parsed_fsid" inode field to store the full 64-bit
root inode number.

Intel-bug-id: LU-2904
Signed-off-by: Fan Yong <fan.yong@...>
Signed-off-by: Andreas Dilger <andreas.dilger@...>
---
 utils/mountd/cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index 517aa62..a7212e7 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
 <at>  <at>  -388,7 +388,7  <at>  <at>  struct parsed_fsid {
 	int fsidtype;
 	/* We could use a union for this, but it would be more
 	 * complicated; why bother? */
-	unsigned int inode;
+	unsigned long long inode; /* We need 64-bits ino# */
 	unsigned int minor;
(Continue reading)

Trond Myklebust | 23 May 2013 00:58
Picon

[PATCH] SUNRPC: Remove redundant call to rpc_set_running() in __rpc_execute()

The RPC_TASK_RUNNING flag will always have been set in rpc_make_runnable()
once we get past the test for out_of_line_wait_on_bit() returning
ERESTARTSYS.

Signed-off-by: Trond Myklebust <Trond.Myklebust@...>
---
 net/sunrpc/sched.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index dcbd69c..b7b32c3 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
 <at>  <at>  -790,7 +790,6  <at>  <at>  static void __rpc_execute(struct rpc_task *task)
 			task->tk_flags |= RPC_TASK_KILLED;
 			rpc_exit(task, -ERESTARTSYS);
 		}
-		rpc_set_running(task);
 		dprintk("RPC: %5u sync task resuming\n", task->tk_pid);
 	}

--

-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Trond Myklebust | 22 May 2013 19:49
Picon

[PATCH] SUNRPC: Prevent an rpc_task wakeup race

The lockless RPC_IS_QUEUED() test in __rpc_execute means that we need to
be careful about ordering the calls to rpc_test_and_set_running(task) and
rpc_clear_queued(task). If we get the order wrong, then we may end up
testing the RPC_TASK_RUNNING flag after __rpc_execute() has looped
and changed the state of the rpc_task.

Signed-off-by: Trond Myklebust <Trond.Myklebust@...>
Cc: stable@...
---
 net/sunrpc/sched.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 52d3802..dcbd69c 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
 <at>  <at>  -324,11 +324,17  <at>  <at>  EXPORT_SYMBOL_GPL(__rpc_wait_for_completion_task);
  * Note: If the task is ASYNC, and is being made runnable after sitting on an
  * rpc_wait_queue, this must be called with the queue spinlock held to protect
  * the wait queue operation.
+ * Note the ordering of rpc_test_and_set_running() and rpc_clear_queued(),
+ * which is needed to ensure that __rpc_execute() doesn't loop (due to the
+ * lockless RPC_IS_QUEUED() test) before we've had a chance to test
+ * the RPC_TASK_RUNNING flag.
  */
 static void rpc_make_runnable(struct rpc_task *task)
 {
+	bool need_wakeup = !rpc_test_and_set_running(task);
+
 	rpc_clear_queued(task);
(Continue reading)

Tigran Mkrtchyan | 22 May 2013 11:59
Picon
Favicon
Gravatar

[PATCH] nfs: include invalid uid/gid in the error message

if client receives an invalid uid/gid debug message is generated.
Unfortunately the actual invalid value is not included.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@...>
---
 fs/nfs/nfs2xdr.c | 4 ++--
 fs/nfs/nfs3xdr.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 62db136..85c0646 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
 <at>  <at>  -319,10 +319,10  <at>  <at>  static int decode_fattr(struct xdr_stream *xdr, struct nfs_fattr *fattr)

 	return 0;
 out_uid:
-	dprintk("NFS: returned invalid uid\n");
+	dprintk("NFS: returned invalid uid %d\n", fattr->uid);
 	return -EINVAL;
 out_gid:
-	dprintk("NFS: returned invalid gid\n");
+	dprintk("NFS: returned invalid gid %d\n", fattr->gid);
 	return -EINVAL;
 out_overflow:
 	print_overflow_msg(__func__, xdr);
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index fa6d721..cd52069 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
(Continue reading)

Mkrtchyan, Tigran | 22 May 2013 11:58
Picon
Favicon
Gravatar

expected unxpected behavior


Hi,

we hit some strange behavior which is expected from one side, but unexpected at the same time.
We run our nfs server with v3 and v4. Due to misconfiguration in idmapping, we got some files
to be owned by uid -1. Which is ok, as with v4 server returns nobody. Nevertheless, this
prevent to list the directory with v3. This is the result of uid_valid()/gid_valid() calls
in nfs3xdr.c:decode_fattr3. The uid_valid/gid_valid checks that provided uid/gid are not -1.
Probably this is ok. My confusion is: a) one file with bad uid/gid prevents listing of a
directory, b) in nfs v3 spec uid3 (as well as uid_t in linux) is unsigned int 32 and
value 0xffffffff is absolutely valid.

Tigran.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Bryan Schumaker | 21 May 2013 23:14
Picon

Announcing nfs-ordeal

Hi everybody!

I've pushed out my Jenkins work to git://git.linux-nfs.org/projects/bjschuma/nfs-ordeal.git under
the new name "nfs-ordeal".  This git repo includes both the Jenkins xml jobs and various helper scripts
that they call to do testing (you'll have to download Jenkins and some plugins on your own - see the
install.sh script).  If you just want a tarball, you can find one at www.linux-nfs.org/~bjschuma/nfs-ordeal-v1.0.tar.gz.

Let me know what you think!

~ Bryan
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

andros | 20 May 2013 20:13
Picon

[PATCH 1/1] NFSv4.1 Fix a pNFS session draining deadlock

From: Andy Adamson <andros@...>

On a CB_RECALL the callback service thread flushes the inode using
filemap_flush prior to scheduling the state manager thread to return the
delegation. When pNFS is used and I/O has not yet gone to the data server
servicing the inode, a LAYOUTGET can preceed the I/O. Unlike the async
filemap_flush call, the LAYOUTGET must proceed to completion.

If the state manager starts to recover data while the inode flush is sending
the LAYOUTGET, a deadlock occurs as the callback service thread holds the
single callback session slot until the flushing is done which blocks the state
manager thread, and the state manager thread has set the session draining bit
which puts the inode flush LAYOUTGET RPC to sleep on the forechannel slot
table waitq.

Separate the draining of the back channel from the draining of the fore channel
by moving the NFS4_SESSION_DRAINING bit from session scope into the fore
and back slot tables.  Drain the back channel first allowing the LAYOUTGET
call to proceed (and fail) so the callback service thread frees the callback
slot. Then proceed with draining the forechannel.

Signed-off-by: Andy Adamson <andros@...>
---
 fs/nfs/callback_proc.c |  2 +-
 fs/nfs/callback_xdr.c  |  2 +-
 fs/nfs/nfs4proc.c      |  2 +-
 fs/nfs/nfs4session.c   |  6 ++++--
 fs/nfs/nfs4session.h   | 13 ++++++++-----
 fs/nfs/nfs4state.c     | 15 +++++++--------
 6 files changed, 22 insertions(+), 18 deletions(-)
(Continue reading)

Trond Myklebust | 20 May 2013 19:17
Picon

[PATCH 1/6] NFSv4.1: Ensure that layoutget is called using the layout credential

Ensure that we use the same credential for layoutget, layoutcommit and
layoutreturn.

Signed-off-by: Trond Myklebust <Trond.Myklebust@...>
---
 fs/nfs/nfs4proc.c       | 1 +
 fs/nfs/pnfs.c           | 1 +
 include/linux/nfs_xdr.h | 1 +
 3 files changed, 3 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 8fbc100..a05397b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
 <at>  <at>  -6348,6 +6348,7  <at>  <at>  nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags)
 		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTGET],
 		.rpc_argp = &lgp->args,
 		.rpc_resp = &lgp->res,
+		.rpc_cred = lgp->cred,
 	};
 	struct rpc_task_setup task_setup_data = {
 		.rpc_client = server->client,
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index c5bd758e..2f86115 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
 <at>  <at>  -766,6 +766,7  <at>  <at>  send_layoutget(struct pnfs_layout_hdr *lo,
 	lgp->args.inode = ino;
 	lgp->args.ctx = get_nfs_open_context(ctx);
 	lgp->gfp_flags = gfp_flags;
(Continue reading)

tigran.mkrtchyan | 19 May 2013 15:27
Picon
Favicon
Gravatar

[PATCH] fix typo in the man page

From: Tigran Mkrtchyan <tigran.mkrtchyan@...>

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@...>
---
 man/man5/nfs4_acl.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/man5/nfs4_acl.5 b/man/man5/nfs4_acl.5
index 6b4fa88..3d5731f 100644
--- a/man/man5/nfs4_acl.5
+++ b/man/man5/nfs4_acl.5
 <at>  <at>  -202,7 +202,7  <at>  <at>  if either this
 .I permission 
 is set in the file/directory or if the delete-child 
 .I permission
-is set in its parent direcory.
+is set in its parent directory.
 .TP
 .B D
 delete-child - remove a file or subdirectory from within the given directory
--

-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jim Rees | 17 May 2013 23:33
Picon

[PATCH v2] nfsd: avoid undefined signed overflow

In C, signed integer overflow results in undefined behavior, but unsigned
overflow wraps around. So do the subtraction first, then cast to signed.

Suggested-by: Joakim Tjernlund <joakim.tjernlund@...>
Signed-off-by: Jim Rees <rees@...>
---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 316ec84..9850329 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
 <at>  <at>  -3427,7 +3427,7  <at>  <at>  grace_disallows_io(struct net *net, struct inode *inode)
 /* Returns true iff a is later than b: */
 static bool stateid_generation_after(stateid_t *a, stateid_t *b)
 {
-	return (s32)a->si_generation - (s32)b->si_generation > 0;
+	return (s32)(a->si_generation - b->si_generation) > 0;
 }

 static __be32 check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_session)
--

-- 
1.8.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Jim Rees | 17 May 2013 22:16
Picon

[PATCH] nfsd: avoid undefined signed overflow

In C, signed integer overflow results in undefined behavior, but unsigned
overflow wraps around. So do the subtraction first, then cast to signed.

Signed-off-by: Jim Rees <rees@...>
---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 316ec84..9850329 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
 <at>  <at>  -3427,7 +3427,7  <at>  <at>  grace_disallows_io(struct net *net, struct inode *inode)
 /* Returns true iff a is later than b: */
 static bool stateid_generation_after(stateid_t *a, stateid_t *b)
 {
-	return (s32)a->si_generation - (s32)b->si_generation > 0;
+	return (s32)(a->si_generation - b->si_generation) > 0;
 }

 static __be32 check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_session)
--

-- 
1.8.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)


Gmane