pnfs-submit-wave3-rev3 bug fixes and cleanup
Subsystems (2)
cover pnfs-submit-wave3-rev3 bug fixes and cleanup
These patches bring the pnfs-submit-wave3-rev3 branch equal to the wave3 patches at git://linux-nfs.org/projects/andros/nfs-2.6.git wave3-on-nfs-for-next-rev4 which is being tested.
-->Andy
PATCH 1/17 SQUASHME pnfs-submit wave3 fix nfs4_ds_connect bug
From: Andy Adamson <[email protected]>
MDS/DS dual role nfs_client not assigned to the nfs4_pnfs_ds->clp
squash into: pnfs-submit-wave3-data-server-connection.patch
--- fs/nfs/nfs4filelayoutdev.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
fs/nfs/nfs4filelayoutdev.c +3 -5
@@ -131,13 +131,13 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds) }if ((clp->cl_exchange_flags &EXCHGID4_FLAG_MASK_PNFS ) !=0 ) { -dprintk ("%s [existing] ip=%x, port=%hu\n" , __func__, -ntohl (ds->ds_ip_addr),ntohs (ds->ds_port)); -if (!is_ds_client (clp)) { status = -ENODEV ; goto out_put; } + ds->ds_clp = clp; +dprintk ("%s [existing] ip=%x, port=%hu\n" , __func__, +ntohl (ds->ds_ip_addr),ntohs (ds->ds_port)); goto out; }
@@ -155,9 +155,7 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds)if (status) goto out_put; - ds->ds_clp = clp; -dprintk ("%s [new] ip=%x, port=%hu\n" , __func__,ntohl (ds->ds_ip_addr),ntohs (ds->ds_port)); out:
Signature · 1 line
1.6.6
PATCH 2/17 SQUASHME fix filelayout_set_lo_fail logic
From: Andy Adamson <[email protected]>
Just use lseg iomode.
squash into pnfs-submit wave3 filelayout read done
--- fs/nfs/nfs4filelayout.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-)
fs/nfs/nfs4filelayout.c +6 -8
@@ -99,12 +99,12 @@ filelayout_get_dserver_offset(struct pnfs_layout_segment *lseg, loff_t offset)/* For data server errors we don't recover from */ static void -filelayout_set_lo_fail (struct pnfs_layout_segment *lseg,fmode_t mode) +filelayout_set_lo_fail (struct pnfs_layout_segment *lseg) { -if (mode &FMODE_WRITE ) { +if (lseg->pls_range.iomode ==IOMODE_RW ) {dprintk ("%s Setting layout IOMODE_RW fail bit\n" , __func__);set_bit (lo_fail_bit (IOMODE_RW ), &lseg->pls_layout->plh_flags); - }else if (mode &FMODE_READ ) { + }else {dprintk ("%s Setting layout IOMODE_READ fail bit\n" , __func__);set_bit (lo_fail_bit (IOMODE_READ ), &lseg->pls_layout->plh_flags); }
@@ -143,9 +143,8 @@ static int filelayout_async_handle_error(struct rpc_task *task, task->tk_status =0 ;return -EAGAIN ;default : -dprintk ("%s DS error %d\n" , __func__, task->tk_status); -/* Layout marked as failed by pnfs_check_io_status. -* Retry I/O through the MDS */ +dprintk ("%s DS error. Retry through MDS %d\n" , __func__, + task->tk_status); *reset =1 ; task->tk_status =0 ;return -EAGAIN ;
@@ -168,8 +167,7 @@ static int filelayout_read_done_cb(struct rpc_task *task, __func__, data->ds_clp, data->ds_clp->cl_session);if (reset) {nfs4_reset_read (task, data); -filelayout_set_lo_fail (data->lseg, - data->args.context->state->state); +filelayout_set_lo_fail (data->lseg); clp =NFS_SERVER (data->inode)->nfs_client; }nfs_restart_rpc (task, clp);
Signature · 1 line
1.6.6
PATCH 3/17 SQUASHME rename orig_offset to mds_offset
From: Andy Adamson <[email protected]>
squash into pnfs_submit: filelayout read
--- fs/nfs/nfs4filelayout.c | 8 ++++---- include/linux/nfs_xdr.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
fs/nfs/nfs4filelayout.c +4 -4
@@ -201,10 +201,10 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data)struct nfs_read_data *rdata = (struct nfs_read_data *)data;dprintk ("--> %s task->tk_status %d\n" , __func__, task->tk_status); -if (rdata->orig_offset) { +if (rdata->mds_offset) {dprintk ("%s new off %llu orig offset %llu\n" , __func__, - rdata->args.offset, rdata->orig_offset); - rdata->args.offset = rdata->orig_offset; + rdata->args.offset, rdata->mds_offset); + rdata->args.offset = rdata->mds_offset; }/* Note this may cause RPC to be resent */
@@ -256,7 +256,7 @@ filelayout_read_pagelist(struct nfs_read_data *data) data->args.fh = fh; data->args.offset =filelayout_get_dserver_offset (lseg, offset); - data->orig_offset = offset; + data->mds_offset = offset;/* Perform an asynchronous read to ds */ nfs_initiate_read(data, ds->ds_clp->cl_rpcclient,
include/linux/nfs_xdr.h +1 -1
@@ -1021,7 +1021,7 @@ struct nfs_read_data {struct nfs_client *ds_clp;/* pNFS data server */ const struct rpc_call_ops *call_ops;/* For pNFS recovery to MDS */ int (*read_done_cb) (struct rpc_task *task,struct nfs_read_data *data); -__u64 orig_offset;/* Filelayout dense stripe */ +__u64 mds_offset;struct page *page_array[NFS_PAGEVEC_SIZE ]; };
Signature · 1 line
1.6.6
PATCH 4/17 SQUASHME rename nfs_read_data call_ops ONE
From: Andy Adamson <[email protected]>
squash into pnfs_submit-wave3-generic-read
--- fs/nfs/pnfs.c | 2 +- include/linux/nfs_xdr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/nfs/pnfs.c +1 -1
@@ -902,7 +902,7 @@ pnfs_try_to_read_data(struct nfs_read_data *rdata,struct nfs_server *nfss =NFS_SERVER (inode);enum pnfs_try_status trypnfs; - rdata->call_ops = call_ops; + rdata->mds_ops = call_ops;dprintk ("%s: Reading ino:%lu %u@%llu\n" , __func__, inode->i_ino, rdata->args.count, rdata->args.offset);
include/linux/nfs_xdr.h +1 -1
@@ -1019,7 +1019,7 @@ struct nfs_read_data {unsigned long timestamp;/* For lease renewal */ struct pnfs_layout_segment *lseg;struct nfs_client *ds_clp;/* pNFS data server */ -const struct rpc_call_ops *call_ops;/* For pNFS recovery to MDS */ +const struct rpc_call_ops *mds_ops;int (*read_done_cb) (struct rpc_task *task,struct nfs_read_data *data);__u64 mds_offset;struct page *page_array[NFS_PAGEVEC_SIZE ];
Signature · 1 line
1.6.6
PATCH 5/17 SQUASHME rename nfs_read_data call_ops TWO
From: Andy Adamson <[email protected]>
squash into pnfs-submit wave3 filelayout read done
--- fs/nfs/nfs4proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/nfs4proc.c +1 -1
@@ -3115,7 +3115,7 @@ void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data) data->ds_clp =NULL ; data->args.fh =NFS_FH (data->inode); data->read_done_cb = nfs4_read_done_cb; - task->tk_ops = data->call_ops; + task->tk_ops = data->mds_ops;rpc_task_reset_client (task,NFS_CLIENT (data->inode)); }EXPORT_SYMBOL_GPL (nfs4_reset_read);
Signature · 1 line
1.6.6
PATCH 6/17 SQUASHME rename nfs_read_data call_ops THREE
From: Andy Adamson <[email protected]>
squash into pnfs_submit-filelayout-read
--- fs/nfs/nfs4filelayout.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4filelayout.c +2 -2
@@ -208,14 +208,14 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data) }/* Note this may cause RPC to be resent */ - rdata->call_ops->rpc_call_done (task, data); + rdata->mds_ops->rpc_call_done (task, data); }static void filelayout_read_release (void *data) {struct nfs_read_data *rdata = (struct nfs_read_data *)data; - rdata->call_ops->rpc_release (data); + rdata->mds_ops->rpc_release (data); }struct rpc_call_ops filelayout_read_call_ops = {
Signature · 1 line
1.6.6
PATCH 7/17 SQUASHME remove reset mds_offset from filelayout_rpc_call_done
From: Andy Adamson <[email protected]>
squash into pnfs_submit: filelayout read
--- fs/nfs/nfs4filelayout.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
fs/nfs/nfs4filelayout.c +0 -5
@@ -201,11 +201,6 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data)struct nfs_read_data *rdata = (struct nfs_read_data *)data;dprintk ("--> %s task->tk_status %d\n" , __func__, task->tk_status); -if (rdata->mds_offset) { -dprintk ("%s new off %llu orig offset %llu\n" , __func__, - rdata->args.offset, rdata->mds_offset); - rdata->args.offset = rdata->mds_offset; - }/* Note this may cause RPC to be resent */ rdata->mds_ops->rpc_call_done (task, data);
Signature · 1 line
1.6.6
PATCH 8/17 SQUASHME reset offset to mds_offset
From: Andy Adamson <[email protected]>
squash into: pnfs-submit wave3 filelayout read done
Update the mds_offset in nfs_readpage_retry so that a failed short-read retry to a DS gets correctly resent through the MDS.
--- fs/nfs/nfs4proc.c | 4 +++- fs/nfs/read.c | 1 + 2 files changed, 4 insertions(+), 1 deletions(-)
fs/nfs/nfs4proc.c +3 -1
@@ -3108,10 +3108,12 @@ static void nfs4_proc_read_setup(struct nfs_read_data *data, struct rpc_message msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READ ]; } -/* Reset the the nfs_read_data to send the read to another server. */ +/* Reset the the nfs_read_data to send the read to the MDS. */ void nfs4_reset_read (struct rpc_task *task,struct nfs_read_data *data) {dprintk ("%s Reset task for i/o through \n" , __func__); +/* offsets will differ in the dense stripe case */ + data->args.offset = data->mds_offset; data->ds_clp =NULL ; data->args.fh =NFS_FH (data->inode); data->read_done_cb = nfs4_read_done_cb;
fs/nfs/read.c +1 -0
@@ -393,6 +393,7 @@ static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *datareturn ;/* Yes, so retry the read at the end of the data */ + data->mds_offset += resp->count; argp->offset += resp->count; argp->pgbase += resp->count; argp->count -= resp->count;
Signature · 1 line
1.6.6
PATCH 9/17 SQUASHME cleanup read_pagelist declaration and comment
From: Andy Adamson <[email protected]>
squash into pnfs_submit-wave3-generic-read
--- fs/nfs/pnfs.h | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
fs/nfs/pnfs.h +4 -8
@@ -76,15 +76,11 @@ struct pnfs_layoutdriver_type {/* test for nfs page cache coalescing */ int (*pg_test)(struct nfs_pageio_descriptor *,struct nfs_page *,struct nfs_page *); -/* read and write pagelist should return just 0 (to indicate that -* the layout code has taken control) or 1 (to indicate that the -* layout code wishes to fall back to normal nfs.) If 0 is returned, -* information can be passed back through nfs_data->res and -* nfs_data->task.tk_status, and the appropriate pnfs done function -* MUST be called. +/* +* Return PNFS_ATTEMPTED to indicate the layout code has attempted +* I/O, else return PNFS_NOT_ATTEMPTED to fall back to normal NFS */ -enum pnfs_try_status - (*read_pagelist) (struct nfs_read_data *nfs_data); +enum pnfs_try_status (*read_pagelist) (struct nfs_read_data *nfs_data); };struct pnfs_layout_hdr {
Signature · 1 line
1.6.6
PATCH 10/17 SQUASHME just return ds in nfs4_fl_prepare_ds
From: Andy Adamson <[email protected]>
squash into: pnfs_submit: filelayout i/o helpers
--- fs/nfs/nfs4filelayoutdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/nfs4filelayoutdev.c +1 -1
@@ -599,5 +599,5 @@ nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx)return NULL ; } } -return dsaddr->ds_list[ds_idx]; +return ds; }
Signature · 1 line
1.6.6
PATCH 11/17 SQUASHME update pnfs_try_to_read_data comment
From: Andy Adamson <[email protected]>
squash into: pnfs_submit-wave3-generic-read
--- fs/nfs/pnfs.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
fs/nfs/pnfs.c +0 -2
@@ -891,8 +891,6 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,/* * Call the appropriate parallel I/O subsystem read function. -* If no I/O device driver exists, or one does match the returned -* fstype, then return a positive status for regular NFS processing. */ enum pnfs_try_status pnfs_try_to_read_data(struct nfs_read_data *rdata,
Signature · 1 line
1.6.6
PATCH 12/17 SQUASHME remove filelayout_async_handle_error comment
From: Andy Adamson <[email protected]>
squash into: pnfs-submit-wave3-filelayout-read-done
--- fs/nfs/nfs4filelayout.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
fs/nfs/nfs4filelayout.c +0 -5
@@ -110,11 +110,6 @@ filelayout_set_lo_fail(struct pnfs_layout_segment *lseg) } } -/* -* Async I/O error handler. -* -* NFS4ERR_OLD_STATEID can not occur with a zero stateid seqid. -*/ static int filelayout_async_handle_error(struct rpc_task *task, struct nfs4_state *state, struct nfs_client *clp,
Signature · 1 line
1.6.6
PATCH 13/17 SQUASHME update nfs4_ds_connect comment
From: Andy Adamson <[email protected]>
squash into: pnfs-submit wave3 data server connection
--- fs/nfs/nfs4filelayoutdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/nfs4filelayoutdev.c +1 -1
@@ -105,7 +105,7 @@ _data_server_lookup_locked(u32 ip_addr, u32 port) }/* -* Create an rpc to the nfs4_pnfs_ds data server +* Create an rpc connection to the nfs4_pnfs_ds data server * Currently only support IPv4 */ static int
Signature · 1 line
1.6.6
PATCH 14/17 SQUASHME don't remove space
From: Andy Adamson <[email protected]>
squash into: pnfs_submit-wave3-pageio-helpers
--- fs/nfs/pagelist.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/nfs/pagelist.c +1 -0
@@ -162,6 +162,7 @@ void nfs_clear_request(struct nfs_page *req) } } +/** * nfs_release_request - Release the count on an NFS read/write request * @req: request to release
Signature · 1 line
1.6.6
PATCH 15/17 SQUASHME set non V41 pg_test to NULL
From: Andy Adamson <[email protected]>
squash into: pnfs_submit-wave3-pageio-helpers
--- fs/nfs/pnfs.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/nfs/pnfs.h +1 -0
@@ -283,6 +283,7 @@ static inline void unset_pnfs_layoutdriver(struct nfs_server *s)static inline void pnfs_pageio_init_read (struct nfs_pageio_descriptor *pgio,struct inode *ino) { + pgio->pg_test =NULL ; }#endif /* CONFIG_NFS_V4_1 */
Signature · 1 line
1.6.6
PATCH 16/17 SQUASHME restore lost put_lseg code
From: Andy Adamson <[email protected]>
Lost in merge from Fred's lseg rewrite.
squash into: pnfs-submit-wave3-lseg-refcounting
--- fs/nfs/pnfs.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
fs/nfs/pnfs.c +4 -1
@@ -278,9 +278,12 @@ put_lseg(struct pnfs_layout_segment *lseg) test_bit(NFS_LSEG_VALID, &lseg->pls_flags)); ino = lseg->pls_layout->plh_inode;if (atomic_dec_and_lock (&lseg->pls_refcount, &ino->i_lock)) { +LIST_HEAD (free_me); +_put_lseg_common (lseg); +list_add (&lseg->pls_list, &free_me);spin_unlock (&ino->i_lock); -free_lseg (lseg); +pnfs_free_lseg_list (&free_me); } }EXPORT_SYMBOL_GPL (put_lseg);
Signature · 1 line
1.6.6
PATCH 17/17 SQUASHME put_layout_hdr can remove nfsi->layout
From: Andy Adamson <[email protected]>
--- fs/nfs/pnfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/pnfs.c +1 -1
@@ -799,7 +799,7 @@ pnfs_update_layout(struct inode *ino,put_layout_hdr (lo); out:dprintk ("%s end, state 0x%lx lseg %p\n" , __func__, - nfsi->layout->plh_flags, lseg); + nfsi->layout ? nfsi->layout->plh_flags :-1 , lseg);return lseg; out_unlock:spin_unlock (&ino->i_lock);
Signature · 1 line
1.6.6
Quoted 6 lines · On 2011-02-11 03:52, [email protected] wrote:
These patches bring the pnfs-submit-wave3-rev3 branch equal to the wave3 patches at
git://linux-nfs.org/projects/andros/nfs-2.6.gitwave3-on-nfs-for-next-rev4 which is being tested.-->Andy
Merged as pnfs-submit-wave3-rev4
I also merged the cleaned up patchset from your tree as pnfs-submit-wave3-rev5 and set pnfs-submit-wave3 to -rev5
Thanks!
Benny