pnfs more wave2 patches
Subsystems (2)
cover pnfs more wave2 patches
These are on top of the current pnfs-submit rebased onto 2.6.37-rc5, per Benny's suggestion.
More wave2 (CB_LAYOUTRECALL and LAYOUTRETURN) patches, based on internal review as well as comments from Trond. These implement a completely forgetful model. The client will *never* send LAYOUTRETURN. We also don't do any waiting in LAYOUTGET, instead falling back to MDS at the smallest sign of trouble.
patches 1 - 7 revert previous roc changes, which are unecessary given that we are not returning anything
patch 8 reverts a fix already done in mainline in a different way
patch 9 prevents a pointless reordering in the cumulative diff
patch 10 fixes a COMMIT bug tickled by the new code
patch 11 - 20 remove LAYOUTRETURN and fix various review issues
patch 21 just brings an existing post-submit patch into the submit branch
patch 22 turns off LAYOUTCOMMIT. It is a temporary stop gap until code can be rearranged so the LAYOUTCOMMIT code can be easily pushed outside of the pnfs-submit branch
Fred
PATCH 1/22 Revert "pnfs-submit: handle NFS4ERR_DELEG_REVOKED for LAYOUTRETURN"
This reverts commit ed527fc7fba08f0665cc6b59d9130a6bd09a2659.
Conflicts:
fs/nfs/pnfs.c
fs/nfs/pnfs.h
--- fs/nfs/nfs4proc.c | 39 +++------------------------------------ fs/nfs/pnfs.c | 6 ++---- fs/nfs/pnfs.h | 14 -------------- 3 files changed, 5 insertions(+), 54 deletions(-)
fs/nfs/nfs4proc.c +3 -36
@@ -1880,16 +1880,6 @@ static void nfs4_close_done(struct rpc_task *task, void *data)nfs4_close_clear_stateid_flags (state, calldata->arg.fmode);break ; -case -NFS4ERR_DELEG_REVOKED : -if (calldata->res.op_bitmask & (NFS4_HAS_LAYOUTCOMMIT | -NFS4_HAS_LAYOUTRETURN )) { -pnfs_mark_layout_revoked (calldata->inode); -/* Retry without layout operations as -* pnfs_roc will find roc_iomode==0 next time around -*/ -rpc_restart_call_prepare (task); -break ; - }case -NFS4ERR_STALE_STATEID :case -NFS4ERR_OLD_STATEID :case -NFS4ERR_BAD_STATEID :
@@ -5646,7 +5636,6 @@ void nfs4_layoutreturn_set_stateid(struct inode *ino,static void nfs4_layoutreturn_done (struct rpc_task *task,void *calldata) {struct nfs4_layoutreturn *lrp = calldata; -struct inode *ino = lrp->args.inode;struct nfs_server *server;dprintk ("--> %s\n" , __func__);
@@ -5655,50 +5644,28 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)return ;if (lrp->args.return_type ==RETURN_FILE ) - server =NFS_SERVER (ino); + server =NFS_SERVER (lrp->args.inode);else server =NULL ;if (nfs4_async_handle_error (task, server,NULL , lrp->clp) == -EAGAIN ) {nfs_restart_rpc (task, lrp->clp);return ; } -switch (task->tk_status) { -case -NFS4ERR_DELEG_REVOKED : - task->tk_status =0 ;/* TODO: revalidate remaining layouts? */ -if (lrp->args.return_type ==RETURN_FILE ) -pnfs_mark_layout_revoked (ino); -break ; -case 0 : -if (lrp->args.return_type ==RETURN_FILE ) -nfs4_layoutreturn_set_stateid (lrp->args.inode, &lrp->res); - } +if ((task->tk_status ==0 ) && (lrp->args.return_type ==RETURN_FILE )) +nfs4_layoutreturn_set_stateid (lrp->args.inode, &lrp->res);dprintk ("<-- %s\n" , __func__); }void nfs4_layoutreturn_file_release (struct inode *ino) {struct pnfs_layout_hdr *lo =NFS_I (ino)->layout; -LIST_HEAD (tmp_list);spin_lock (&ino->i_lock); -if (test_bit (NFS_LAYOUT_REVOKED , &lo->plh_flags)) { -struct pnfs_layout_range range = { - .iomode =IOMODE_ANY , - .offset =0 , - .length =NFS4_MAX_UINT64 , - }; - -/* layout driver's free_lseg may block, hence we don't -* call pnfs_free_lseg_list under the spin_lock */ -pnfs_clear_lseg_list (lo, &tmp_list, &range); -clear_bit (NFS_LAYOUT_REVOKED , &lo->plh_flags); - } lo->plh_block_lgets--; lo->plh_outstanding--;if (!pnfs_layoutgets_blocked (lo,NULL ))rpc_wake_up (&NFS_I (ino)->lo_rpcwaitq_stateid);spin_unlock (&ino->i_lock); -pnfs_free_lseg_list (&tmp_list);put_layout_hdr (ino); }
fs/nfs/pnfs.c +2 -4
@@ -376,7 +376,7 @@ static void mark_lseg_invalid(struct pnfs_layout_segment *lseg, }/* Returns false if there was nothing to do, true otherwise */ -bool +static bool pnfs_clear_lseg_list (struct pnfs_layout_hdr *lo,struct list_head *tmp_list,struct pnfs_layout_range *range) {
@@ -629,12 +629,10 @@ pnfs_roc(struct nfs4_closedata *data)spin_lock (&data->inode->i_lock); lo =NFS_I (data->inode)->layout;if (!lo || lo->roc_iomode ==0 || -test_bit (NFS_LAYOUT_BULK_RECALL , &lo->plh_flags) || -test_bit (NFS_LAYOUT_REVOKED , &lo->plh_flags)) +test_bit (NFS_LAYOUT_BULK_RECALL , &lo->plh_flags)) goto out_nolayout; range.iomode = lo->roc_iomode; - lo->roc_iomode =0 ;list_for_each_entry_safe (lseg, tmp, &lo->segs, fi_list)if (should_free_lseg (&lseg->range, &range)) {mark_lseg_invalid (lseg, &tmp_list);
fs/nfs/pnfs.h +0 -14
@@ -56,7 +56,6 @@ enum {NFS_LAYOUT_RW_FAILED ,/* get rw layout failed stop trying */ NFS_LAYOUT_BULK_RECALL ,/* bulk recall affecting layout */ NFS_LAYOUT_NEED_LCOMMIT, /* LAYOUTCOMMIT needed */ - NFS_LAYOUT_REVOKED, /* layout revoked by the server */ };/* Per-layout driver specific registration structure */
@@ -220,8 +219,6 @@ void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *,void pnfs_pageio_init_write (struct nfs_pageio_descriptor *,struct inode *);bool pnfs_layoutgets_blocked (struct pnfs_layout_hdr *lo,nfs4_stateid *stateid);int pnfs_layout_process (struct nfs4_layoutget *lgp); -bool pnfs_clear_lseg_list (struct pnfs_layout_hdr *,struct list_head *tmp_list, -struct pnfs_layout_range *);void pnfs_free_lseg_list (struct list_head *tmp_list);void pnfs_destroy_layout (struct nfs_inode *);void pnfs_destroy_all_layouts (struct nfs_client *);
@@ -293,12 +290,6 @@ layoutcommit_needed(struct nfs_inode *nfsi) test_bit(NFS_LAYOUT_NEED_LCOMMIT, &nfsi->layout->plh_flags); } -static inline void -pnfs_mark_layout_revoked (struct inode *ino) -{ -set_bit (NFS_LAYOUT_REVOKED , &NFS_I (ino)->layout->plh_flags); -} -#else /* CONFIG_NFS_V4_1 */ static inline void pnfs_destroy_all_layouts (struct nfs_client *clp)
@@ -423,11 +414,6 @@ static inline void nfs4_layoutreturn_set_stateid(struct inode *ino, { } -static inline void -pnfs_mark_layout_revoked (struct inode *ino) -{ -} -#endif /* CONFIG_NFS_V4_1 */ #endif /* FS_NFS_PNFS_H */
Signature · 1 line
1.7.2.1
PATCH 2/22 Revert "SQUASHME: pnfs-submit: encode layoutreturn on close before close"
In reply to Fred IsamanThis reverts commit aafe6a6b39b0ddf87496d3912b308bf08ed6b2b9.
--- fs/nfs/nfs4xdr.c | 35 +++++++++++++++++------------------ fs/nfs/pnfs.c | 1 - 2 files changed, 17 insertions(+), 19 deletions(-)
fs/nfs/nfs4xdr.c +17 -18
@@ -441,17 +441,17 @@ static int nfs4_stat_to_errno(int);#define NFS4_enc_close_sz (compound_encode_hdr_maxsz + \ encode_sequence_maxsz + \ encode_putfh_maxsz + \ - encode_layoutcommit_maxsz + \ - encode_layoutreturn_maxsz + \ encode_close_maxsz + \ - encode_getattr_maxsz) + encode_getattr_maxsz + \ + encode_layoutreturn_maxsz + \ + encode_layoutcommit_maxsz)#define NFS4_dec_close_sz (compound_decode_hdr_maxsz + \ decode_sequence_maxsz + \ decode_putfh_maxsz + \ - decode_layoutcommit_maxsz + \ - decode_layoutreturn_maxsz + \ decode_close_maxsz + \ - decode_getattr_maxsz) + decode_getattr_maxsz + \ + decode_layoutreturn_maxsz + \ + decode_layoutcommit_maxsz)#define NFS4_enc_setattr_sz (compound_encode_hdr_maxsz + \ encode_sequence_maxsz + \ encode_putfh_maxsz + \
@@ -2160,10 +2160,10 @@ static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closeaencode_putfh (&xdr, args->fh, &hdr);if (args->op_bitmask &NFS4_HAS_LAYOUTCOMMIT )/* layoutcommit set */ encode_layoutcommit (&xdr, &args->lc_args, &hdr); -if (args->op_bitmask &NFS4_HAS_LAYOUTRETURN )/* layoutreturn set */ -encode_layoutreturn (&xdr, &args->lr_args, &hdr);encode_close (&xdr, args, &hdr);encode_getfattr (&xdr, args->bitmask, &hdr); +if (args->op_bitmask &NFS4_HAS_LAYOUTRETURN )/* layoutreturn set */ +encode_layoutreturn (&xdr, &args->lr_args, &hdr);encode_nops (&hdr);return 0 ; }
@@ -5743,16 +5743,9 @@ static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, __be32 *p, struct nfs_clos status =decode_putfh (&xdr);if (status) goto out; -if (res->op_bitmask &NFS4_HAS_LAYOUTCOMMIT ) { - status =decode_layoutcommit (&xdr); -if (status) - goto out; - } -if (res->op_bitmask &NFS4_HAS_LAYOUTRETURN ) { - status =decode_layoutreturn (&xdr, &res->lr_res); -if (status) - goto out; - } +/* We pay no attention to the layoutcommit return */ +if (res->op_bitmask &NFS4_HAS_LAYOUTCOMMIT ) +decode_layoutcommit (&xdr); status =decode_close (&xdr, res);if (status !=0 ) goto out;
@@ -5764,6 +5757,12 @@ static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, __be32 *p, struct nfs_clos*/ decode_getfattr (&xdr, res->fattr, res->server, !RPC_IS_ASYNC (rqstp->rq_task)); +/* +* With the forgetful model, we pay no attention to the +* layoutreturn status. +*/ +if (res->op_bitmask &NFS4_HAS_LAYOUTRETURN ) +decode_layoutreturn (&xdr, &res->lr_res); out:return status; }
fs/nfs/pnfs.c +0 -1
@@ -625,7 +625,6 @@ pnfs_roc(struct nfs4_closedata *data)LIST_HEAD (tmp_list);bool found = false; - data->arg.op_bitmask = data->res.op_bitmask =0 ;spin_lock (&data->inode->i_lock); lo =NFS_I (data->inode)->layout; if (!lo || lo->roc_iomode == 0 ||
Signature · 1 line
1.7.2.1
PATCH 3/22 Revert "SQUASHME: make roc patches compile without v4.1"
In reply to Fred IsamanThis reverts commit a512f09586628b295c960e8df35d42726180f96f.
--- fs/nfs/nfs4proc.c | 55 ++++++++++++++++++++++++++++++++-------------------- fs/nfs/nfs4xdr.c | 34 -------------------------------- fs/nfs/pnfs.h | 24 ----------------------- 3 files changed, 34 insertions(+), 79 deletions(-)
fs/nfs/nfs4proc.c +34 -21
@@ -74,6 +74,8 @@ static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,static int nfs4_do_setattr (struct inode *inode,struct rpc_cred *cred,struct nfs_fattr *fattr,struct iattr *sattr,struct nfs4_state *state); +static void nfs4_layoutreturn_set_stateid (struct inode *ino, +struct nfs4_layoutreturn_res *res);/* Prevent leaks of NFSv4 errors into userland */ static int nfs4_map_errors (int err)
@@ -1842,8 +1844,17 @@ static void nfs4_free_closedata(void *data)nfs_free_seqid (calldata->arg.seqid);nfs4_put_state_owner (sp);path_put (&calldata->path); -if (calldata->res.op_bitmask &NFS4_HAS_LAYOUTRETURN ) -nfs4_layoutreturn_file_release (calldata->inode); +if (calldata->res.op_bitmask &NFS4_HAS_LAYOUTRETURN ) { +struct pnfs_layout_hdr *lo =NFS_I (calldata->inode)->layout; + +spin_lock (&lo->inode->i_lock); + lo->plh_block_lgets--; + lo->plh_outstanding--; +if (!pnfs_layoutgets_blocked (lo,NULL )) +rpc_wake_up (&NFS_I (lo->inode)->lo_rpcwaitq_stateid); +spin_unlock (&lo->inode->i_lock); +put_layout_hdr (lo->inode); + }kfree (calldata); }
@@ -1932,13 +1943,18 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)/* Are there layout segments to return on close? */ if (pnfs_roc (calldata)) {struct nfs_inode *nfsi =NFS_I (calldata->inode); -if (pnfs_return_layout_barrier (nfsi, &calldata->arg.lr_args.range)) {dprintk ("%s: waiting on barrier\n" , __func__);/* FIXME race with wake here */ rpc_sleep_on (&nfsi->lo_rpcwaitq, task,NULL ); -nfs4_layoutreturn_file_release (calldata->inode); +spin_lock (&calldata->inode->i_lock); + nfsi->layout->plh_block_lgets--; + nfsi->layout->plh_outstanding--; +if (!pnfs_layoutgets_blocked (nfsi->layout,NULL )) +rpc_wake_up (&nfsi->lo_rpcwaitq_stateid); +spin_unlock (&calldata->inode->i_lock); +put_layout_hdr (calldata->inode);return ; } }
@@ -5620,8 +5636,8 @@ nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata)rpc_call_start (task); } -void nfs4_layoutreturn_set_stateid (struct inode *ino, -struct nfs4_layoutreturn_res *res) +static void nfs4_layoutreturn_set_stateid (struct inode *ino, +struct nfs4_layoutreturn_res *res) {struct pnfs_layout_hdr *lo =NFS_I (ino)->layout;
@@ -5656,26 +5672,23 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)dprintk ("<-- %s\n" , __func__); } -void nfs4_layoutreturn_file_release (struct inode *ino) -{ -struct pnfs_layout_hdr *lo =NFS_I (ino)->layout; - -spin_lock (&ino->i_lock); - lo->plh_block_lgets--; - lo->plh_outstanding--; -if (!pnfs_layoutgets_blocked (lo,NULL )) -rpc_wake_up (&NFS_I (ino)->lo_rpcwaitq_stateid); -spin_unlock (&ino->i_lock); -put_layout_hdr (ino); -} -static void nfs4_layoutreturn_release (void *calldata) {struct nfs4_layoutreturn *lrp = calldata;dprintk ("--> %s return_type %d\n" , __func__, lrp->args.return_type); -if (lrp->args.return_type ==RETURN_FILE ) -nfs4_layoutreturn_file_release (lrp->args.inode); +if (lrp->args.return_type ==RETURN_FILE ) { +struct inode *ino = lrp->args.inode; +struct pnfs_layout_hdr *lo =NFS_I (ino)->layout; + +spin_lock (&ino->i_lock); + lo->plh_block_lgets--; + lo->plh_outstanding--; +if (!pnfs_layoutgets_blocked (lo,NULL )) +rpc_wake_up (&NFS_I (ino)->lo_rpcwaitq_stateid); +spin_unlock (&ino->i_lock); +put_layout_hdr (ino); + }kfree (calldata);dprintk ("<-- %s\n" , __func__); }
fs/nfs/nfs4xdr.c +0 -34
@@ -338,10 +338,6 @@ static int nfs4_stat_to_errno(int);#else /* CONFIG_NFS_V4_1 */ #define encode_sequence_maxsz 0#define decode_sequence_maxsz 0 -#define encode_layoutcommit_maxsz 0 -#define decode_layoutcommit_maxsz 0 -#define encode_layoutreturn_maxsz 0 -#define decode_layoutreturn_maxsz 0#endif /* CONFIG_NFS_V4_1 */ #define NFS4_enc_compound_sz (1024)/* XXX: large enough? */
@@ -1933,22 +1929,6 @@ encode_layoutreturn(struct xdr_stream *xdr, hdr->nops++; hdr->replen += decode_layoutreturn_maxsz; } -#else -static int -encode_layoutcommit (struct xdr_stream *xdr, -const struct nfs4_layoutcommit_op_args *args, -struct compound_hdr *hdr) -{ -return 0 ; -} - -static void -encode_layoutreturn (struct xdr_stream *xdr, -const struct nfs4_layoutreturn_args *args, -struct compound_hdr *hdr) -{ -} -#endif /* CONFIG_NFS_V4_1 */ /*
@@ -5352,20 +5332,6 @@ out_overflow:print_overflow_msg (__func__, xdr); return -EIO; } - -#else - -static int decode_layoutcommit (struct xdr_stream *xdr) -{ -return 0 ; -} - -static int decode_layoutreturn (struct xdr_stream *xdr, -struct nfs4_layoutreturn_res *res) -{ -return 0 ; -} -#endif /* CONFIG_NFS_V4_1 */ /*
fs/nfs/pnfs.h +0 -24
@@ -188,9 +188,6 @@ extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp);extern int nfs4_proc_layoutcommit (struct nfs4_layoutcommit_data *data,int issync);extern int nfs4_proc_layoutreturn (struct nfs4_layoutreturn *lrp,bool wait); -extern void nfs4_layoutreturn_file_release (struct inode *ino); -extern void nfs4_layoutreturn_set_stateid (struct inode *ino, -struct nfs4_layoutreturn_res *res);/* pnfs.c */ void get_layout_hdr (struct pnfs_layout_hdr *lo);
@@ -393,27 +390,6 @@ pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *ino) pgio->pg_lseg =NULL ; } -static inline void nfs4_layoutreturn_file_release (struct inode *ino) -{ -} - -static inline bool pnfs_roc (struct nfs4_closedata *data) -{ -return false; -} - -static inline bool pnfs_return_layout_barrier (struct nfs_inode *nfsi, -struct pnfs_layout_range *range) -{ -BUG (); -return false; -} - -static inline void nfs4_layoutreturn_set_stateid (struct inode *ino, -struct nfs4_layoutreturn_res *res) -{ -} -#endif /* CONFIG_NFS_V4_1 */ #endif /* FS_NFS_PNFS_H */
Signature · 1 line
1.7.2.1
PATCH 4/22 Revert "pnfs_submit: roc add layoutcommit op to close compound"
In reply to Fred IsamanThis reverts commit 361887febfa01e06c5ae7c38cc6867da3e4cf31d.
--- fs/nfs/nfs4xdr.c | 11 ++--------- fs/nfs/pnfs.c | 9 +-------- include/linux/nfs_xdr.h | 2 -- 3 files changed, 3 insertions(+), 19 deletions(-)
fs/nfs/nfs4xdr.c +2 -9
@@ -439,15 +439,13 @@ static int nfs4_stat_to_errno(int); encode_putfh_maxsz + \ encode_close_maxsz + \ encode_getattr_maxsz + \ - encode_layoutreturn_maxsz + \ - encode_layoutcommit_maxsz) + encode_layoutreturn_maxsz)#define NFS4_dec_close_sz (compound_decode_hdr_maxsz + \ decode_sequence_maxsz + \ decode_putfh_maxsz + \ decode_close_maxsz + \ decode_getattr_maxsz + \ - decode_layoutreturn_maxsz + \ - decode_layoutcommit_maxsz) + decode_layoutreturn_maxsz)#define NFS4_enc_setattr_sz (compound_encode_hdr_maxsz + \ encode_sequence_maxsz + \ encode_putfh_maxsz + \
@@ -2138,8 +2136,6 @@ static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closeaencode_compound_hdr (&xdr, req, &hdr);encode_sequence (&xdr, &args->seq_args, &hdr);encode_putfh (&xdr, args->fh, &hdr); -if (args->op_bitmask &NFS4_HAS_LAYOUTCOMMIT )/* layoutcommit set */ -encode_layoutcommit (&xdr, &args->lc_args, &hdr);encode_close (&xdr, args, &hdr);encode_getfattr (&xdr, args->bitmask, &hdr);if (args->op_bitmask &NFS4_HAS_LAYOUTRETURN )/* layoutreturn set */
@@ -5709,9 +5705,6 @@ static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, __be32 *p, struct nfs_clos status =decode_putfh (&xdr);if (status) goto out; -/* We pay no attention to the layoutcommit return */ -if (res->op_bitmask &NFS4_HAS_LAYOUTCOMMIT ) -decode_layoutcommit (&xdr); status =decode_close (&xdr, res);if (status !=0 ) goto out;
fs/nfs/pnfs.c +1 -8
@@ -612,6 +612,7 @@ pnfs_return_layout_barrier(struct nfs_inode *nfsi,* Return on close * * No LAYOUTRETURNS can be sent when BULK RECALL flag is set. +* FIXME: add layoutcommit operation if layoutcommit_needed is true. */ bool pnfs_roc (struct nfs4_closedata *data)
@@ -639,14 +640,6 @@ pnfs_roc(struct nfs4_closedata *data) }if (found == false) goto out_nolayout; - -/* Add layoutcommit operation if needed */ -if (layoutcommit_needed (NFS_I (data->inode))) { -pnfs_layoutcommit_setup (data->inode, &data->arg.lc_args, false); - data->res.op_bitmask |=NFS4_HAS_LAYOUTCOMMIT ; - data->arg.op_bitmask |=NFS4_HAS_LAYOUTCOMMIT ; - } -/* Stop new and drop response to outstanding LAYOUTGETS */ lo->plh_block_lgets++; lo->plh_outstanding++;
include/linux/nfs_xdr.h +0 -2
@@ -352,7 +352,6 @@ struct nfs_open_confirmres {/* op_bitmask bits */ #define NFS4_HAS_LAYOUTRETURN 0x01 -#define NFS4_HAS_LAYOUTCOMMIT 0x02struct nfs_closeargs {struct nfs_fh * fh;
@@ -361,7 +360,6 @@ struct nfs_closeargs {fmode_t fmode;const u32 * bitmask;u32 op_bitmask;/* which optional ops to encode */ -struct nfs4_layoutcommit_op_args lc_args;/* optional */ struct nfs4_layoutreturn_args lr_args;/* optional */ struct nfs4_sequence_args seq_args; };
Signature · 1 line
1.7.2.1
PATCH 5/22 Revert "pnfs-submit refactor pnfs_layoutcommit_setup"
In reply to Fred IsamanThis reverts commit 536da3e86e791f72b2ef81831391d2f1e9dd38f7.
--- fs/nfs/pnfs.c | 106 +++++++++++++++++++++++++++++++-------------------------- fs/nfs/pnfs.h | 3 -- 2 files changed, 58 insertions(+), 51 deletions(-)
fs/nfs/pnfs.c +58 -48
@@ -1191,88 +1191,98 @@ pnfs_try_to_commit(struct nfs_write_data *data, }/* -* Set up the arguments required for the RPC call. +* Set up the argument/result storage required for the RPC call. */ -void +static int pnfs_layoutcommit_setup (struct inode *inode, -struct nfs4_layoutcommit_op_args *args,bool use_cred) +struct nfs4_layoutcommit_data *data, +loff_t write_begin_pos,loff_t write_end_pos) { -struct nfs_inode *nfsi =NFS_I (inode); -loff_t write_begin_pos, write_end_pos; +struct nfs_server *nfss =NFS_SERVER (inode); +int result =0 ;dprintk ("--> %s\n" , __func__); -assert_spin_locked (&inode->i_lock); + data->inode = inode; + data->args.fh =NFS_FH (inode); + data->args.op.layout_type = nfss->pnfs_curr_ld->id; + data->res.fattr = &data->fattr; +nfs_fattr_init (&data->fattr); -/* -* Clear layoutcommit properties in the inode so -* new layoutcommit info can be generated +/* Set values from inode so it can be reset */ - write_begin_pos = nfsi->layout->write_begin_pos; - write_end_pos = nfsi->layout->write_end_pos; - nfsi->layout->write_begin_pos =0 ; - nfsi->layout->write_end_pos =0 ; -/* In the true case, caller has passed on the cred to another struct */ -if (use_cred == false) -put_rpccred (nfsi->layout->cred); - nfsi->layout->cred =NULL ; -__clear_bit (NFS_LAYOUT_NEED_LCOMMIT , &nfsi->layout->plh_flags); -/* FIXME: figure out what to do here */ -memcpy (args->stateid.data, nfsi->layout->stateid.data, -NFS4_STATEID_SIZE ); - - args->layout_type =NFS_SERVER (inode)->pnfs_curr_ld->id; - - args->range.iomode =IOMODE_RW ; - args->range.offset = write_begin_pos; - args->range.length = write_end_pos - write_begin_pos +1 ; - args->lastbytewritten =min (write_end_pos,i_size_read (inode) -1 ); + data->args.op.range.iomode =IOMODE_RW ; + data->args.op.range.offset = write_begin_pos; + data->args.op.range.length = write_end_pos - write_begin_pos +1 ; + data->args.op.lastbytewritten =min (write_end_pos, +i_size_read (inode) -1 ); + data->args.bitmask = nfss->attr_bitmask; + data->res.server = nfss; + +dprintk ("<-- %s Status %d\n" , __func__, result); +return result; } -/* -* Issue a async layoutcommit for an inode. -* Returns 0 on success, negative value for error +/* Issue a async layoutcommit for an inode. */ int pnfs_layoutcommit_inode (struct inode *inode,int sync) {struct nfs4_layoutcommit_data *data; -int status = -ENOMEM ; +struct nfs_inode *nfsi =NFS_I (inode); +loff_t write_begin_pos; +loff_t write_end_pos; + +int status =0 ;dprintk ("%s Begin (sync:%d)\n" , __func__, sync); +BUG_ON (!has_layout (nfsi)); + data =kzalloc (sizeof (*data),GFP_NOFS );if (!data) - goto out; +return -ENOMEM ; - status =0 ;spin_lock (&inode->i_lock); -if (!layoutcommit_needed (NFS_I (inode))) { +if (!layoutcommit_needed (nfsi)) {spin_unlock (&inode->i_lock); -kfree (data); - goto out; + goto out_free; } -/* Use the layoutcommit cred */ - data->args.cred =NFS_I (inode)->layout->cred; -/* Set up layoutcommit operation args */ -pnfs_layoutcommit_setup (inode, &data->args.op, true); +/* Clear layoutcommit properties in the inode so +* new lc info can be generated +*/ + write_begin_pos = nfsi->layout->write_begin_pos; + write_end_pos = nfsi->layout->write_end_pos; + data->args.cred = nfsi->layout->cred; + nfsi->layout->write_begin_pos =0 ; + nfsi->layout->write_end_pos =0 ; + nfsi->layout->cred =NULL ; +__clear_bit (NFS_LAYOUT_NEED_LCOMMIT , &nfsi->layout->plh_flags); +memcpy (data->args.op.stateid.data, nfsi->layout->stateid.data, +NFS4_STATEID_SIZE );/* Reference for layoutcommit matched in pnfs_layoutcommit_release */ get_layout_hdr (NFS_I (inode)->layout); -spin_unlock (&inode->i_lock); - data->args.fh =NFS_FH (inode); - data->args.bitmask =NFS_SERVER (inode)->attr_bitmask; +spin_unlock (&inode->i_lock); - data->inode = inode; - data->res.server =NFS_SERVER (inode); - data->res.fattr = &data->fattr; -nfs_fattr_init (&data->fattr); +/* Set up layout commit args */ + status =pnfs_layoutcommit_setup (inode, data, write_begin_pos, + write_end_pos); +if (status) { +/* The layout driver failed to setup the layoutcommit */ +put_rpccred (data->args.cred); +put_layout_hdr (inode); + goto out_free; + } status =nfs4_proc_layoutcommit (data, sync); out:dprintk ("%s end (err:%d)\n" , __func__, status);return status; +out_free: +kfree (data); + goto out; }/*
fs/nfs/pnfs.h +0 -3
@@ -231,9 +231,6 @@ void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo, int notify_bit, atomic_t *notify_count, struct list_head *tmp_list);bool pnfs_roc (struct nfs4_closedata *data); -void pnfs_layoutcommit_setup (struct inode *inode, -struct nfs4_layoutcommit_op_args *args, -bool use_cred);static inline bool has_layout (struct nfs_inode *nfsi)
Signature · 1 line
1.7.2.1
PATCH 6/22 Revert "pnfs-submit refactor layoutcommit xdr structures"
In reply to Fred IsamanThis reverts commit 4cce4b96893b2d76a3e65c6dc84dc86425ee718b.
--- fs/nfs/nfs4proc.c | 23 ++++++++++++----------- fs/nfs/nfs4xdr.c | 27 +++++++++++++++++---------- fs/nfs/pnfs.c | 21 ++++++++++++--------- include/linux/nfs_xdr.h | 19 ++++++++++--------- 4 files changed, 51 insertions(+), 39 deletions(-)
fs/nfs/nfs4proc.c +12 -11
@@ -5530,7 +5530,7 @@ static void nfs4_layoutcommit_prepare(struct rpc_task *task, void *data) {struct nfs4_layoutcommit_data *ldata = (struct nfs4_layoutcommit_data *)data; -struct nfs_server *server =NFS_SERVER (ldata->inode); +struct nfs_server *server =NFS_SERVER (ldata->args.inode);if (nfs4_setup_sequence (server,NULL , &ldata->args.seq_args, &ldata->res.seq_res,1 , task))
@@ -5543,7 +5543,7 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata) {struct nfs4_layoutcommit_data *data = (struct nfs4_layoutcommit_data *)calldata; -struct nfs_server *server =NFS_SERVER (data->inode); +struct nfs_server *server =NFS_SERVER (data->args.inode);if (!nfs4_sequence_done (task, &data->res.seq_res))return ;
@@ -5560,8 +5560,8 @@ static void nfs4_layoutcommit_release(void *lcdata) (struct nfs4_layoutcommit_data *)lcdata;/* Matched by get_layout in pnfs_layoutcommit_inode */ -put_layout_hdr (data->inode); -put_rpccred (data->args.cred); +put_layout_hdr (data->args.inode); +put_rpccred (data->cred);kfree (lcdata); }
@@ -5579,11 +5579,11 @@ nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, int issync) .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTCOMMIT], .rpc_argp = &data->args, .rpc_resp = &data->res, - .rpc_cred = data->args.cred, + .rpc_cred = data->cred, };struct rpc_task_setup task_setup_data = { .task = &data->task, - .rpc_client =NFS_CLIENT (data->inode), + .rpc_client =NFS_CLIENT (data->args.inode), .rpc_message = &msg, .callback_ops = &nfs4_layoutcommit_ops, .callback_data = data,
@@ -5592,12 +5592,13 @@ nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, int issync)struct rpc_task *task;int status =0 ; -dprintk ("NFS: initiating layoutcommit call. %llu@%llu lbw: %llu " +dprintk ("NFS: %4d initiating layoutcommit call. %llu@%llu lbw: %llu " "type: %d issync %d\n" , - data->args.op.range.length, - data->args.op.range.offset, - data->args.op.lastbytewritten, - data->args.op.layout_type, issync); + data->task.tk_pid, + data->args.range.length, + data->args.range.offset, + data->args.lastbytewritten, + data->args.layout_type, issync); task =rpc_run_task (&task_setup_data);if (IS_ERR (task))
fs/nfs/nfs4xdr.c +17 -10
@@ -1868,7 +1868,7 @@ encode_layoutget(struct xdr_stream *xdr,static int encode_layoutcommit (struct xdr_stream *xdr, -const struct nfs4_layoutcommit_op_args *args, +const struct nfs4_layoutcommit_args *args,struct compound_hdr *hdr) {__be32 *p;
@@ -1885,7 +1885,14 @@ encode_layoutcommit(struct xdr_stream *xdr, p =xdr_encode_opaque_fixed (p, args->stateid.data,NFS4_STATEID_SIZE ); *p++ =cpu_to_be32 (1 );/* newoffset = TRUE */ p =xdr_encode_hyper (p, args->lastbytewritten); - *p =cpu_to_be32 (0 );/* nt_timechanged = FALSE */ + *p =cpu_to_be32 (args->time_modify_changed !=0 ); +if (args->time_modify_changed) { + p =reserve_space (xdr,12 ); + *p++ =cpu_to_be32 (0 ); + *p++ =cpu_to_be32 (args->time_modify.tv_sec); + *p =cpu_to_be32 (args->time_modify.tv_nsec); + } + p =reserve_space (xdr,4 ); *p =cpu_to_be32 (args->layout_type);
@@ -2812,7 +2819,7 @@ static int nfs4_xdr_enc_layoutcommit(struct rpc_rqst *req, uint32_t *p,encode_compound_hdr (&xdr, req, &hdr);encode_sequence (&xdr, &args->seq_args, &hdr);encode_putfh (&xdr, args->fh, &hdr); -encode_layoutcommit (&xdr, &args->op, &hdr); +encode_layoutcommit (&xdr, args, &hdr);encode_getfattr (&xdr, args->bitmask, &hdr);encode_nops (&hdr);return 0 ;
@@ -5301,10 +5308,10 @@ out_overflow:return -EIO ; } -static int decode_layoutcommit (struct xdr_stream *xdr) +static int decode_layoutcommit (struct xdr_stream *xdr, +struct rpc_rqst *req, +struct nfs4_layoutcommit_res *res) { -u32 sizechanged; -u64 newsize;__be32 *p;int status;
@@ -5315,13 +5322,13 @@ static int decode_layoutcommit(struct xdr_stream *xdr) p =xdr_inline_decode (xdr,4 );if (unlikely (!p)) goto out_overflow; - sizechanged =be32_to_cpup (p); + res->sizechanged =be32_to_cpup (p); -if (sizechanged) { +if (res->sizechanged) { p =xdr_inline_decode (xdr,8 );if (unlikely (!p)) goto out_overflow; -xdr_decode_hyper (p, &newsize); +xdr_decode_hyper (p, &res->newsize); }return 0 ; out_overflow:
@@ -6456,7 +6463,7 @@ static int nfs4_xdr_dec_layoutcommit(struct rpc_rqst *rqstp, uint32_t *p, status =decode_putfh (&xdr);if (status) goto out; - status =decode_layoutcommit (&xdr); + status =decode_layoutcommit (&xdr, rqstp, res);if (status) goto out; decode_getfattr(&xdr, res->fattr, res->server,
fs/nfs/pnfs.c +12 -9
@@ -1203,18 +1203,21 @@ pnfs_layoutcommit_setup(struct inode *inode,dprintk ("--> %s\n" , __func__); - data->inode = inode; + data->args.inode = inode; data->args.fh =NFS_FH (inode); - data->args.op.layout_type = nfss->pnfs_curr_ld->id; + data->args.layout_type = nfss->pnfs_curr_ld->id; data->res.fattr = &data->fattr;nfs_fattr_init (&data->fattr); +/* TODO: Need to determine the correct values */ + data->args.time_modify_changed =0 ; +/* Set values from inode so it can be reset */ - data->args.op.range.iomode =IOMODE_RW ; - data->args.op.range.offset = write_begin_pos; - data->args.op.range.length = write_end_pos - write_begin_pos +1 ; - data->args.op.lastbytewritten =min (write_end_pos, + data->args.range.iomode =IOMODE_RW ; + data->args.range.offset = write_begin_pos; + data->args.range.length = write_end_pos - write_begin_pos +1 ; + data->args.lastbytewritten =min (write_end_pos,i_size_read (inode) -1 ); data->args.bitmask = nfss->attr_bitmask; data->res.server = nfss;
@@ -1254,12 +1257,12 @@ pnfs_layoutcommit_inode(struct inode *inode, int sync)*/ write_begin_pos = nfsi->layout->write_begin_pos; write_end_pos = nfsi->layout->write_end_pos; - data->args.cred = nfsi->layout->cred; + data->cred = nfsi->layout->cred; nfsi->layout->write_begin_pos =0 ; nfsi->layout->write_end_pos =0 ; nfsi->layout->cred =NULL ;__clear_bit (NFS_LAYOUT_NEED_LCOMMIT , &nfsi->layout->plh_flags); -memcpy (data->args.op.stateid.data, nfsi->layout->stateid.data, +memcpy (data->args.stateid.data, nfsi->layout->stateid.data,NFS4_STATEID_SIZE );/* Reference for layoutcommit matched in pnfs_layoutcommit_release */
@@ -1272,7 +1275,7 @@ pnfs_layoutcommit_inode(struct inode *inode, int sync) write_end_pos);if (status) {/* The layout driver failed to setup the layoutcommit */ -put_rpccred (data->args.cred); +put_rpccred (data->cred);put_layout_hdr (inode); goto out_free; }
include/linux/nfs_xdr.h +10 -9
@@ -225,24 +225,25 @@ struct nfs4_layoutget {struct pnfs_layout_segment **lsegpp; }; -struct nfs4_layoutcommit_op_args { +struct nfs4_layoutcommit_args {nfs4_stateid stateid;__u64 lastbytewritten; +__u32 time_modify_changed; +struct timespec time_modify; +const u32 *bitmask; +struct nfs_fh *fh; +struct inode *inode;/* Values set by layout driver */ struct pnfs_layout_range range;__u32 layout_type; -}; - -struct nfs4_layoutcommit_args { -struct nfs4_layoutcommit_op_args op; -const u32 *bitmask; -struct nfs_fh *fh; -struct rpc_cred *cred; +void *layoutdriver_data;struct nfs4_sequence_args seq_args; };struct nfs4_layoutcommit_res { +__u32 sizechanged; +__u64 newsize;struct nfs_fattr *fattr;const struct nfs_server *server;struct nfs4_sequence_res seq_res;
@@ -250,7 +251,7 @@ struct nfs4_layoutcommit_res {struct nfs4_layoutcommit_data {struct rpc_task task; -struct inode *inode; +struct rpc_cred *cred;struct nfs_fattr fattr;struct nfs4_layoutcommit_args args;struct nfs4_layoutcommit_res res;
Signature · 1 line
1.7.2.1
PATCH 7/22 Revert "pnfs-submit: roc add layoutreturn op to close compound"
In reply to Fred IsamanThis reverts commit b2ae4b414a3a56d0dff75b1278c7c359fd81b4b7.
--- fs/nfs/nfs4proc.c | 73 +++++++++++++--------------------------------- fs/nfs/nfs4state.c | 17 ++++++++++- fs/nfs/nfs4xdr.c | 14 +-------- fs/nfs/pnfs.c | 64 ++++------------------------------------- fs/nfs/pnfs.h | 1 - include/linux/nfs_xdr.h | 19 ------------ 6 files changed, 45 insertions(+), 143 deletions(-)
fs/nfs/nfs4proc.c +21 -52
@@ -74,8 +74,6 @@ static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,static int nfs4_do_setattr (struct inode *inode,struct rpc_cred *cred,struct nfs_fattr *fattr,struct iattr *sattr,struct nfs4_state *state); -static void nfs4_layoutreturn_set_stateid (struct inode *ino, -struct nfs4_layoutreturn_res *res);/* Prevent leaks of NFSv4 errors into userland */ static int nfs4_map_errors (int err)
@@ -1835,6 +1833,16 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,return err; } +struct nfs4_closedata { +struct path path; +struct inode *inode; +struct nfs4_state *state; +struct nfs_closeargs arg; +struct nfs_closeres res; +struct nfs_fattr fattr; +unsigned long timestamp; +}; +static void nfs4_free_closedata (void *data) {struct nfs4_closedata *calldata = data;
@@ -1844,17 +1852,6 @@ static void nfs4_free_closedata(void *data)nfs_free_seqid (calldata->arg.seqid);nfs4_put_state_owner (sp);path_put (&calldata->path); -if (calldata->res.op_bitmask &NFS4_HAS_LAYOUTRETURN ) { -struct pnfs_layout_hdr *lo =NFS_I (calldata->inode)->layout; - -spin_lock (&lo->inode->i_lock); - lo->plh_block_lgets--; - lo->plh_outstanding--; -if (!pnfs_layoutgets_blocked (lo,NULL )) -rpc_wake_up (&NFS_I (lo->inode)->lo_rpcwaitq_stateid); -spin_unlock (&lo->inode->i_lock); -put_layout_hdr (lo->inode); - }kfree (calldata); }
@@ -1884,9 +1881,6 @@ static void nfs4_close_done(struct rpc_task *task, void *data)switch (task->tk_status) {case 0 :nfs_set_open_stateid (state, &calldata->res.stateid,0 ); -if (calldata->res.op_bitmask &NFS4_HAS_LAYOUTRETURN ) -nfs4_layoutreturn_set_stateid (calldata->inode, - &calldata->res.lr_res);renew_lease (server, calldata->timestamp);nfs4_close_clear_stateid_flags (state, calldata->arg.fmode);
@@ -1938,27 +1932,8 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)return ; } -if (calldata->arg.fmode ==0 ) { +if (calldata->arg.fmode ==0 ) task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE ]; -/* Are there layout segments to return on close? */ -if (pnfs_roc (calldata)) { -struct nfs_inode *nfsi =NFS_I (calldata->inode); -if (pnfs_return_layout_barrier (nfsi, - &calldata->arg.lr_args.range)) { -dprintk ("%s: waiting on barrier\n" , __func__); -/* FIXME race with wake here */ -rpc_sleep_on (&nfsi->lo_rpcwaitq, task,NULL ); -spin_lock (&calldata->inode->i_lock); - nfsi->layout->plh_block_lgets--; - nfsi->layout->plh_outstanding--; -if (!pnfs_layoutgets_blocked (nfsi->layout,NULL )) -rpc_wake_up (&nfsi->lo_rpcwaitq_stateid); -spin_unlock (&calldata->inode->i_lock); -put_layout_hdr (calldata->inode); -return ; - } - } - }nfs_fattr_init (calldata->res.fattr); calldata->timestamp = jiffies;
@@ -5626,7 +5601,6 @@ nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata)if (pnfs_return_layout_barrier (nfsi, &lrp->args.range)) {dprintk ("%s: waiting on barrier\n" , __func__); -/* FIXME race with wake here */ rpc_sleep_on (&nfsi->lo_rpcwaitq, task,NULL );return ; }
@@ -5637,19 +5611,6 @@ nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata)rpc_call_start (task); } -static void nfs4_layoutreturn_set_stateid (struct inode *ino, -struct nfs4_layoutreturn_res *res) -{ -struct pnfs_layout_hdr *lo =NFS_I (ino)->layout; - -spin_lock (&ino->i_lock); -if (res->lrs_present) -pnfs_set_layout_stateid (lo, &res->stateid, true); -else -BUG_ON (!list_empty (&lo->segs)); -spin_unlock (&ino->i_lock); -} -static void nfs4_layoutreturn_done (struct rpc_task *task,void *calldata) {struct nfs4_layoutreturn *lrp = calldata;
@@ -5668,8 +5629,16 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)nfs_restart_rpc (task, lrp->clp);return ; } -if ((task->tk_status ==0 ) && (lrp->args.return_type ==RETURN_FILE )) -nfs4_layoutreturn_set_stateid (lrp->args.inode, &lrp->res); +if ((task->tk_status ==0 ) && (lrp->args.return_type ==RETURN_FILE )) { +struct pnfs_layout_hdr *lo =NFS_I (lrp->args.inode)->layout; + +spin_lock (&lo->inode->i_lock); +if (lrp->res.lrs_present) +pnfs_set_layout_stateid (lo, &lrp->res.stateid, true); +else +BUG_ON (!list_empty (&lo->segs)); +spin_unlock (&lo->inode->i_lock); + }dprintk ("<-- %s\n" , __func__); }
fs/nfs/nfs4state.c +16 -1
@@ -618,8 +618,23 @@ static void __nfs4_close(struct path *path, struct nfs4_state *state,if (!call_close) {nfs4_put_open_state (state);nfs4_put_state_owner (owner); - }else + }else { +u32 roc_iomode; +struct nfs_inode *nfsi =NFS_I (state->inode); + +if (has_layout (nfsi) && + (roc_iomode =pnfs_layout_roc_iomode (nfsi)) !=0 ) { +struct pnfs_layout_range range = { + .iomode = roc_iomode, + .offset =0 , + .length =NFS4_MAX_UINT64 , + }; + +pnfs_return_layout (state->inode, &range, wait); + } +nfs4_do_close (path, state, gfp_mask, wait); + } }void nfs4_close_state (struct path *path,struct nfs4_state *state,fmode_t fmode)
fs/nfs/nfs4xdr.c +2 -12
@@ -438,14 +438,12 @@ static int nfs4_stat_to_errno(int); encode_sequence_maxsz + \ encode_putfh_maxsz + \ encode_close_maxsz + \ - encode_getattr_maxsz + \ - encode_layoutreturn_maxsz) + encode_getattr_maxsz)#define NFS4_dec_close_sz (compound_decode_hdr_maxsz + \ decode_sequence_maxsz + \ decode_putfh_maxsz + \ decode_close_maxsz + \ - decode_getattr_maxsz + \ - decode_layoutreturn_maxsz) + decode_getattr_maxsz)#define NFS4_enc_setattr_sz (compound_encode_hdr_maxsz + \ encode_sequence_maxsz + \ encode_putfh_maxsz + \
@@ -2145,8 +2143,6 @@ static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closeaencode_putfh (&xdr, args->fh, &hdr);encode_close (&xdr, args, &hdr);encode_getfattr (&xdr, args->bitmask, &hdr); -if (args->op_bitmask &NFS4_HAS_LAYOUTRETURN )/* layoutreturn set */ -encode_layoutreturn (&xdr, &args->lr_args, &hdr);encode_nops (&hdr);return 0 ; }
@@ -5723,12 +5719,6 @@ static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, __be32 *p, struct nfs_clos*/ decode_getfattr (&xdr, res->fattr, res->server, !RPC_IS_ASYNC (rqstp->rq_task)); -/* -* With the forgetful model, we pay no attention to the -* layoutreturn status. -*/ -if (res->op_bitmask &NFS4_HAS_LAYOUTRETURN ) -decode_layoutreturn (&xdr, &res->lr_res); out:return status; }
fs/nfs/pnfs.c +6 -58
77 lines not on this page · raw message
fs/nfs/pnfs.h +0 -1
@@ -230,7 +230,6 @@ void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo,struct pnfs_layout_range *range, int notify_bit, atomic_t *notify_count, struct list_head *tmp_list); -bool pnfs_roc (struct nfs4_closedata *data);static inline bool has_layout (struct nfs_inode *nfsi)
include/linux/nfs_xdr.h +0 -19
@@ -350,18 +350,12 @@ struct nfs_open_confirmres {/* * Arguments to the close call. */ - -/* op_bitmask bits */ -#define NFS4_HAS_LAYOUTRETURN 0x01 -struct nfs_closeargs {struct nfs_fh * fh;nfs4_stateid * stateid;struct nfs_seqid * seqid;fmode_t fmode;const u32 * bitmask; -u32 op_bitmask;/* which optional ops to encode */ -struct nfs4_layoutreturn_args lr_args;/* optional */ struct nfs4_sequence_args seq_args; };
@@ -370,21 +364,8 @@ struct nfs_closeres {struct nfs_fattr * fattr;struct nfs_seqid * seqid;const struct nfs_server *server; -u32 op_bitmask;/* which optional ops encoded */ -struct nfs4_layoutreturn_res lr_res;/* optional */ struct nfs4_sequence_res seq_res; }; - -struct nfs4_closedata { -struct path path; -struct inode *inode; -struct nfs4_state *state; -struct nfs_closeargs arg; -struct nfs_closeres res; -struct nfs_fattr fattr; -unsigned long timestamp; -}; -/* * * Arguments to the lock,lockt, and locku call. * */
Signature · 1 line
1.7.2.1
PATCH 8/22 Revert "FIXME: NFS: clear fsinfo before sendign rpc"
In reply to Fred IsamanThis reverts commit 462e3c258daa62a5331a0febff3e224da6af5481.
Not needed since layouttype is initialized by
commit 85e174ba6b: NFS: set layout driver
--- fs/nfs/client.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
fs/nfs/client.c +0 -1
@@ -950,7 +950,6 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str goto out_error; } -memset (&fsinfo,0 ,sizeof (fsinfo)); fsinfo.fattr = fattr; fsinfo.layouttype =0 ; error = clp->rpc_ops->fsinfo (server, mntfh, &fsinfo);
Signature · 1 line
1.7.2.1
PATCH 9/22 SQUASHME onto "pnfs_submit: cb_layoutrecall": revert pointless reordering
In reply to Fred Isaman--- fs/nfs/callback_xdr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/callback_xdr.c +1 -1
@@ -641,8 +641,8 @@ preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op) *op = &callback_ops[op_nr];break ; -case OP_CB_NOTIFY :case OP_CB_NOTIFY_DEVICEID : +case OP_CB_NOTIFY :case OP_CB_PUSH_DELEG :case OP_CB_RECALLABLE_OBJ_AVAIL :case OP_CB_WANTS_CANCELLED :
Signature · 1 line
1.7.2.1
PATCH 10/22 pnfs-submit: wave4: fix bug dealing with commit split between DS and MDS
In reply to Fred IsamanThe file layout driver could send the wrong data structure to the MDS on a commit split between DS and MDS.
--- fs/nfs/nfs4filelayout.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-)
fs/nfs/nfs4filelayout.c +13 -2
@@ -497,6 +497,7 @@ filelayout_commit(struct nfs_write_data *data, int sync)struct list_head **ds_page_list =NULL ;u16 *indices_used;int num_indices_seen =0 ; +bool used_mds = false;const struct rpc_call_ops *call_ops;struct rpc_clnt *clnt;struct nfs_write_data **clone_list =NULL ;
@@ -546,11 +547,21 @@ filelayout_commit(struct nfs_write_data *data, int sync)if (!clone_list) goto mem_error;for (i =0 ; i < num_indices_seen -1 ; i++) { +if (indices_used[i] ==NFS4_PNFS_MAX_MULTI_CNT ) { + used_mds = true; + clone_list[i] = data; + }else { + clone_list[i] =filelayout_clone_write_data (data); +if (!clone_list[i]) + goto mem_error; + } + } +if (used_mds) { clone_list[i] =filelayout_clone_write_data (data);if (!clone_list[i]) goto mem_error; - } - clone_list[i] = data; + }else + clone_list[i] = data;/* * Now send off the RPCs to each ds. Note that it is important * that any RPC to the MDS be sent last (or at least after all
Signature · 1 line
1.7.2.1
PATCH 11/22 pnfs-submit: wave2: NFS4ERR_RESOURCE is not a valid error for CB_LAYOUTRECALL
In reply to Fred Isamanand neither is SERVERFAULT, which pretty much means our only option on memory allocation failure is DELAY.
--- fs/nfs/callback_proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/callback_proc.c +1 -1
@@ -348,7 +348,7 @@ static u32 do_callback_layoutrecall(struct nfs_client *clp,dprintk ("%s enter, type=%i\n" , __func__, args->cbl_recall_type); new =kmalloc (sizeof (*new),GFP_KERNEL );if (!new) { - res =NFS4ERR_RESOURCE ; + res =NFS4ERR_DELAY ; goto out; }memcpy (&new->pcl_args, args,sizeof (*args));
Signature · 1 line
1.7.2.1
PATCH 12/22 pnfs-submit: wave2: rewrite validate_bitmap_values to obey spec
In reply to Fred IsamanIt was checking that at least one known bit was set. It needs to check no unknown bit was set. From RFC5661, section 20.6.3:
When a bit is set in the type mask that corresponds to an undefined type of recallable object, NFS4ERR_INVAL MUST be returned.
--- fs/nfs/callback.h | 1 + fs/nfs/callback_proc.c | 27 ++++----------------------- 2 files changed, 5 insertions(+), 23 deletions(-)
fs/nfs/callback.h +1 -0
@@ -126,6 +126,7 @@ extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 +#define RCA4_TYPE_MASK_ALL 0xf31fstruct cb_recallanyargs {struct sockaddr *craa_addr;
fs/nfs/callback_proc.c +4 -23
@@ -661,28 +661,10 @@ out_putclient: goto out; } -static inline bool -validate_bitmap_values (const unsigned long *mask) +static bool +validate_bitmap_values (unsigned long mask) { -int i; - -if (*mask ==0 ) -return true; -if (test_bit (RCA4_TYPE_MASK_RDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_WDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_DIR_DLG , mask) || -test_bit (RCA4_TYPE_MASK_FILE_LAYOUT , mask) || -test_bit (RCA4_TYPE_MASK_BLK_LAYOUT , mask)) -return true; -for (i =RCA4_TYPE_MASK_OBJ_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OBJ_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -for (i =RCA4_TYPE_MASK_OTHER_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OTHER_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -return false; +return mask & ~RCA4_TYPE_MASK_ALL ; } __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,
@@ -702,8 +684,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)); status =cpu_to_be32 (NFS4ERR_INVAL ); -if (!validate_bitmap_values ((const unsigned long *) - &args->craa_type_mask)) +if (!validate_bitmap_values (args->craa_type_mask)) goto out; status =cpu_to_be32 (NFS4_OK );
Signature · 1 line
1.7.2.1
Re: [PATCH 12/22] pnfs-submit: wave2: rewrite validate_bitmap_values to obey spec
Quoted 47 lines · Fred Isaman
It was checking that at least one known bit was set. It needs to check no unknown bit was set. From RFC5661, section 20.6.3:
When a bit is set in the type mask that corresponds to an undefined type of recallable object,
NFS4ERR_INVALMUST be returned.Signed-off-by Fred Isaman <[email protected]>--- fs/nfs/callback.h | 1 + fs/nfs/callback_proc.c | 27 ++++----------------------- 2 files changed, 5 insertions(+), 23 deletions(-)fs/nfs/callback.h +1
-0@@ -126,6 +126,7 @@ extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 +#define RCA4_TYPE_MASK_ALL 0xf31fstruct cb_recallanyargs {struct sockaddr *craa_addr;fs/nfs/callback_proc.c +2
-12@@ -661,28 +661,10 @@ out_putclient: goto out; } -static inline bool -validate_bitmap_values (const unsigned long *mask) +static bool +validate_bitmap_values (unsigned long mask) { -int i; - -if (*mask ==0 ) -return true; -if (test_bit (RCA4_TYPE_MASK_RDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_WDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_DIR_DLG , mask) || -test_bit (RCA4_TYPE_MASK_FILE_LAYOUT , mask) || -test_bit (RCA4_TYPE_MASK_BLK_LAYOUT , mask)) -return true;
fs/nfs/callback_proc.c out_putclient: · line 667
Quoted 10 lines
fs/nfs/callback_proc.c +1
-9-for (i =RCA4_TYPE_MASK_OBJ_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OBJ_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -for (i =RCA4_TYPE_MASK_OTHER_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OTHER_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -return false; +return mask & ~RCA4_TYPE_MASK_ALL ;
Hmm, shouldn't that be
return (mask & ~RCA4_TYPE_MASK_ALL) == 0;
Benny
Quoted 13 lines
fs/nfs/callback_proc.c +1
-2} __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,@@ -702,8 +684,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)); status =cpu_to_be32 (NFS4ERR_INVAL ); -if (!validate_bitmap_values ((const unsigned long *) - &args->craa_type_mask)) +if (!validate_bitmap_values (args->craa_type_mask)) goto out; status =cpu_to_be32 (NFS4_OK );
Re: [PATCH 12/22] pnfs-submit: wave2: rewrite validate_bitmap_values to obey spec
Quoted 60 lines · Benny Halevy
Quoted 47 lines · Fred Isaman
It was checking that at least one known bit was set. It needs to check no unknown bit was set. From RFC5661, section 20.6.3:
When a bit is set in the type mask that corresponds to an undefined type of recallable object,
NFS4ERR_INVALMUST be returned.Signed-off-by Fred Isaman <[email protected]>---
fs/nfs/callback.h| 1 +fs/nfs/callback_proc.c| 27 ++++-----------------------2 files changed, 5 insertions(+), 23 deletions(-)fs/nfs/callback.h +1
-0@@ -126,6 +126,7 @@ extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 +#define RCA4_TYPE_MASK_ALL 0xf31fstruct cb_recallanyargs {struct sockaddr *craa_addr;fs/nfs/callback_proc.c +2
-12@@ -661,28 +661,10 @@ out_putclient: goto out; } -static inline bool -validate_bitmap_values (const unsigned long *mask) +static bool +validate_bitmap_values (unsigned long mask) { -int i; - -if (*mask ==0 ) -return true; -if (test_bit (RCA4_TYPE_MASK_RDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_WDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_DIR_DLG , mask) || -test_bit (RCA4_TYPE_MASK_FILE_LAYOUT , mask) || -test_bit (RCA4_TYPE_MASK_BLK_LAYOUT , mask)) -return true;fs/nfs/callback_proc.c out_putclient: · line 667
Quoted 10 lines
fs/nfs/callback_proc.c +1
-9-for (i =RCA4_TYPE_MASK_OBJ_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OBJ_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -for (i =RCA4_TYPE_MASK_OTHER_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OTHER_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -return false; +return mask & ~RCA4_TYPE_MASK_ALL ;Hmm, shouldn't that be
Quoted 4 lines
return (mask & ~RCA4_TYPE_MASK_ALL) == 0;Benny
Yes, you are right.
Fred
Quoted 13 lines
Quoted 13 lines
fs/nfs/callback_proc.c +1
-2} __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,@@ -702,8 +684,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)); status =cpu_to_be32 (NFS4ERR_INVAL ); -if (!validate_bitmap_values ((const unsigned long *) - &args->craa_type_mask)) +if (!validate_bitmap_values (args->craa_type_mask)) goto out; status =cpu_to_be32 (NFS4_OK );
Re: [PATCH 12/22] pnfs-submit: wave2: rewrite validate_bitmap_values to obey spec
Quoted 65 lines · Fred Isaman
Quoted 62 lines · Benny Halevy
Quoted 47 lines · Fred Isaman
It was checking that at least one known bit was set. It needs to check no unknown bit was set. From RFC5661, section 20.6.3:
When a bit is set in the type mask that corresponds to an undefined type of recallable object,
NFS4ERR_INVALMUST be returned.Signed-off-by Fred Isaman <[email protected]>---
fs/nfs/callback.h| 1 +fs/nfs/callback_proc.c| 27 ++++-----------------------2 files changed, 5 insertions(+), 23 deletions(-)fs/nfs/callback.h +1
-0@@ -126,6 +126,7 @@ extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 +#define RCA4_TYPE_MASK_ALL 0xf31fstruct cb_recallanyargs {struct sockaddr *craa_addr;fs/nfs/callback_proc.c +2
-12@@ -661,28 +661,10 @@ out_putclient: goto out; } -static inline bool -validate_bitmap_values (const unsigned long *mask) +static bool +validate_bitmap_values (unsigned long mask) { -int i; - -if (*mask ==0 ) -return true; -if (test_bit (RCA4_TYPE_MASK_RDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_WDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_DIR_DLG , mask) || -test_bit (RCA4_TYPE_MASK_FILE_LAYOUT , mask) || -test_bit (RCA4_TYPE_MASK_BLK_LAYOUT , mask)) -return true;fs/nfs/callback_proc.c out_putclient: · line 667
Quoted 10 lines
fs/nfs/callback_proc.c +1
-9-for (i =RCA4_TYPE_MASK_OBJ_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OBJ_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -for (i =RCA4_TYPE_MASK_OTHER_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OTHER_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -return false; +return mask & ~RCA4_TYPE_MASK_ALL ;Hmm, shouldn't that be
return (mask & ~RCA4_TYPE_MASK_ALL) == 0;
Quoted 4 lines
Quoted 2 lines
Benny
Yes, you are right.
OK. This is fixed in my branch to be released asap.
I've reverted large parts of this patchset in the post-submit stream to restore layoutcommit and layoutreturn, but not their embedding in the CLOSE compound. I also kept the cleanups and bug fixes. I'll send out the post-submit when it's ready.
Some more work will be required to restore the original patches author and signoffees.
This is the list as of now:
pick af44531 Revert "pnfs-submit: wave2: remove forgotten layoutreturn struct definitions" pick c465549 Revert "pnfs-submit: Turn off layoutcommits"
pick 0f4ba67 Revert "pnfs-submit: wave2: remove all LAYOUTRETURN code"
pick 486db47 Revert "pnfs-submit: wave2: Remove LAYOUTRETURN from return on close"
pick 484c935 FIXME: roc should return layout on last close (This patch just adds a FIXME comment.)
pick 8698772 Revert "pnfs-submit: wave2: remove cl_layoutrecalls list" pick 263879b Revert "pnfs-submit: wave2: Pull out all recall initiated LAYOUTRETURNS" pick 693765f Revert "pnfs-submit: wave2: Don't wait in layoutget"
pick de56e11 Revert "pnfs-submit: wave2: check that partial LAYOUTGET return is ignored"
Anything else you had in mind?
Benny
Quoted 21 lines
Fred
Quoted 6 lines
Quoted 6 lines
fs/nfs/callback_proc.c +0
-0} __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,@@ -702,8 +684,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR));Quoted 7 lines
fs/nfs/callback_proc.c __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, · line 690
Quoted 7 lines
fs/nfs/callback_proc.c +1
-2status =cpu_to_be32 (NFS4ERR_INVAL ); -if (!validate_bitmap_values ((const unsigned long *) - &args->craa_type_mask)) +if (!validate_bitmap_values (args->craa_type_mask)) goto out; status =cpu_to_be32 (NFS4_OK );--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 12/22] pnfs-submit: wave2: rewrite validate_bitmap_values to obey spec
Quoted 66 lines · Benny Halevy
Quoted 65 lines · Fred Isaman
Quoted 62 lines · Benny Halevy
Quoted 47 lines · Fred Isaman
It was checking that at least one known bit was set. It needs to check no unknown bit was set. From RFC5661, section 20.6.3:
When a bit is set in the type mask that corresponds to an undefined type of recallable object,
NFS4ERR_INVALMUST be returned.Signed-off-by Fred Isaman <[email protected]>---
fs/nfs/callback.h| 1 +fs/nfs/callback_proc.c| 27 ++++-----------------------2 files changed, 5 insertions(+), 23 deletions(-)fs/nfs/callback.h +1
-0@@ -126,6 +126,7 @@ extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 +#define RCA4_TYPE_MASK_ALL 0xf31fstruct cb_recallanyargs {struct sockaddr *craa_addr;fs/nfs/callback_proc.c +2
-12@@ -661,28 +661,10 @@ out_putclient: goto out; } -static inline bool -validate_bitmap_values (const unsigned long *mask) +static bool +validate_bitmap_values (unsigned long mask) { -int i; - -if (*mask ==0 ) -return true; -if (test_bit (RCA4_TYPE_MASK_RDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_WDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_DIR_DLG , mask) || -test_bit (RCA4_TYPE_MASK_FILE_LAYOUT , mask) || -test_bit (RCA4_TYPE_MASK_BLK_LAYOUT , mask)) -return true;fs/nfs/callback_proc.c out_putclient: · line 667
Quoted 10 lines
fs/nfs/callback_proc.c +1
-9-for (i =RCA4_TYPE_MASK_OBJ_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OBJ_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -for (i =RCA4_TYPE_MASK_OTHER_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OTHER_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -return false; +return mask & ~RCA4_TYPE_MASK_ALL ;Hmm, shouldn't that be
return (mask & ~RCA4_TYPE_MASK_ALL) == 0;
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Benny
Yes, you are right.
OK. This is fixed in my branch to be released asap.
Thanks. I have a bunch more minor code cleanups that I'll send once I see what you have, unless you want them immediately. I'll also have a rebase of the pnfs-submit branch with the wave2 patches pushed down to the bottom shortly after I see your branch.
Quoted 9 lines
I've reverted large parts of this patchset in the post-submit stream to restore layoutcommit and layoutreturn, but not their embedding in the CLOSE compound. I also kept the cleanups and bug fixes. I'll send out the post-submit when it's ready.
Some more work will be required to restore the original patches author and signoffees.This is the list as of now:
Quoted 8 lines
pick af44531 Revert "pnfs-submit: wave2: remove forgotten layoutreturn struct definitions" pick c465549 Revert "pnfs-submit: Turn off layoutcommits"
pick 0f4ba67 Revert "pnfs-submit: wave2: remove all LAYOUTRETURN code"
pick 486db47 Revert "pnfs-submit: wave2: Remove LAYOUTRETURN from return on close"pick 484c935 FIXME: roc should return layout on last close (This patch just adds a FIXME comment.)
The above looks good.
Quoted 3 lines
pick 8698772 Revert "pnfs-submit: wave2: remove
cl_layoutrecallslist" pick 263879b Revert "pnfs-submit: wave2: Pull out all recall initiated LAYOUTRETURNS" pick 693765f Revert "pnfs-submit: wave2: Don't wait in layoutget"
Just note the Trond was highly resistant to the above.
Quoted 2 lines
pick de56e11 Revert "pnfs-submit: wave2: check that partial LAYOUTGET return is ignored"
We need some sort of check that we got what we asked for, given that the xdr code can chop the servers reply.
Fred
Quoted 25 lines
Anything else you had in mind?
Benny
Quoted 21 lines
Fred
Quoted 6 lines
Quoted 6 lines
fs/nfs/callback_proc.c +0
-0} __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,@@ -702,8 +684,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR));Quoted 7 lines
fs/nfs/callback_proc.c __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, · line 690
Quoted 7 lines
fs/nfs/callback_proc.c +1
-2status =cpu_to_be32 (NFS4ERR_INVAL ); -if (!validate_bitmap_values ((const unsigned long *) - &args->craa_type_mask)) +if (!validate_bitmap_values (args->craa_type_mask)) goto out; status =cpu_to_be32 (NFS4_OK );--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 12/22] pnfs-submit: wave2: rewrite validate_bitmap_values to obey spec
Quoted 69 lines · Fred Isaman
Quoted 66 lines · Benny Halevy
Quoted 65 lines · Fred Isaman
Quoted 62 lines · Benny Halevy
Quoted 47 lines · Fred Isaman
It was checking that at least one known bit was set. It needs to check no unknown bit was set. From RFC5661, section 20.6.3:
When a bit is set in the type mask that corresponds to an undefined type of recallable object,
NFS4ERR_INVALMUST be returned.Signed-off-by Fred Isaman <[email protected]>---
fs/nfs/callback.h| 1 +fs/nfs/callback_proc.c| 27 ++++-----------------------2 files changed, 5 insertions(+), 23 deletions(-)fs/nfs/callback.h +1
-0@@ -126,6 +126,7 @@ extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 +#define RCA4_TYPE_MASK_ALL 0xf31fstruct cb_recallanyargs {struct sockaddr *craa_addr;fs/nfs/callback_proc.c +2
-12@@ -661,28 +661,10 @@ out_putclient: goto out; } -static inline bool -validate_bitmap_values (const unsigned long *mask) +static bool +validate_bitmap_values (unsigned long mask) { -int i; - -if (*mask ==0 ) -return true; -if (test_bit (RCA4_TYPE_MASK_RDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_WDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_DIR_DLG , mask) || -test_bit (RCA4_TYPE_MASK_FILE_LAYOUT , mask) || -test_bit (RCA4_TYPE_MASK_BLK_LAYOUT , mask)) -return true;fs/nfs/callback_proc.c out_putclient: · line 667
Quoted 10 lines
fs/nfs/callback_proc.c +1
-9-for (i =RCA4_TYPE_MASK_OBJ_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OBJ_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -for (i =RCA4_TYPE_MASK_OTHER_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OTHER_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -return false; +return mask & ~RCA4_TYPE_MASK_ALL ;Hmm, shouldn't that be
return (mask & ~RCA4_TYPE_MASK_ALL) == 0;
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Benny
Yes, you are right.
OK. This is fixed in my branch to be released asap.
Thanks. I have a bunch more minor code cleanups that I'll send once I see what you have, unless you want them immediately. I'll also have a rebase of the pnfs-submit branch with the wave2 patches pushed down to the bottom shortly after I see your branch.
I prefer that you send them now.
Quoted 18 lines
Quoted 9 lines
I've reverted large parts of this patchset in the post-submit stream to restore layoutcommit and layoutreturn, but not their embedding in the CLOSE compound. I also kept the cleanups and bug fixes. I'll send out the post-submit when it's ready.
Some more work will be required to restore the original patches author and signoffees.This is the list as of now:
Quoted 8 lines
pick af44531 Revert "pnfs-submit: wave2: remove forgotten layoutreturn struct definitions" pick c465549 Revert "pnfs-submit: Turn off layoutcommits"
pick 0f4ba67 Revert "pnfs-submit: wave2: remove all LAYOUTRETURN code"
pick 486db47 Revert "pnfs-submit: wave2: Remove LAYOUTRETURN from return on close"pick 484c935 FIXME: roc should return layout on last close (This patch just adds a FIXME comment.)
Quoted 8 lines
The above looks good.
Quoted 3 lines
pick 8698772 Revert "pnfs-submit: wave2: remove
cl_layoutrecallslist" pick 263879b Revert "pnfs-submit: wave2: Pull out all recall initiated LAYOUTRETURNS" pick 693765f Revert "pnfs-submit: wave2: Don't wait in layoutget"Just note the Trond was highly resistant to the above.
I understand that in the forgetful client model but eventually returning the layout on close will be more efficient overall vs. having the server poll the client.
Quoted 4 lines
Quoted 2 lines
pick de56e11 Revert "pnfs-submit: wave2: check that partial LAYOUTGET return is ignored"
We need some sort of check that we got what we asked for, given that the xdr code can chop the servers reply.
The post-submit world is supposed to handle partial layouts correctly, as this is required for the obj and block layouts so we can't just blindly toss away partial layouts.
If the files layout driver won't support partial layouts we can restrict this (sigh, ugly) only for it.
Benny
Quoted 29 lines
Fred
Quoted 25 lines
Anything else you had in mind?
Benny
Quoted 21 lines
Fred
Quoted 6 lines
Quoted 6 lines
fs/nfs/callback_proc.c +0
-0} __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,@@ -702,8 +684,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR));Quoted 7 lines
fs/nfs/callback_proc.c __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, · line 690
Quoted 7 lines
fs/nfs/callback_proc.c +1
-2status =cpu_to_be32 (NFS4ERR_INVAL ); -if (!validate_bitmap_values ((const unsigned long *) - &args->craa_type_mask)) +if (!validate_bitmap_values (args->craa_type_mask)) goto out; status =cpu_to_be32 (NFS4_OK );--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 12/22] pnfs-submit: wave2: rewrite validate_bitmap_values to obey spec
Quoted 73 lines · Benny Halevy
Quoted 72 lines · Fred Isaman
Quoted 69 lines · Benny Halevy
Quoted 68 lines · Fred Isaman
Quoted 64 lines · Benny Halevy
Quoted 47 lines · Fred Isaman
It was checking that at least one known bit was set. It needs to check no unknown bit was set. From RFC5661, section 20.6.3:
When a bit is set in the type mask that corresponds to an undefined type of recallable object,
NFS4ERR_INVALMUST be returned.Signed-off-by Fred Isaman <[email protected]>---
fs/nfs/callback.h| 1 +fs/nfs/callback_proc.c| 27 ++++-----------------------2 files changed, 5 insertions(+), 23 deletions(-)fs/nfs/callback.h +1
-0@@ -126,6 +126,7 @@ extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 +#define RCA4_TYPE_MASK_ALL 0xf31fstruct cb_recallanyargs {struct sockaddr *craa_addr;fs/nfs/callback_proc.c +2
-12@@ -661,28 +661,10 @@ out_putclient: goto out; } -static inline bool -validate_bitmap_values (const unsigned long *mask) +static bool +validate_bitmap_values (unsigned long mask) { -int i; - -if (*mask ==0 ) -return true; -if (test_bit (RCA4_TYPE_MASK_RDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_WDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_DIR_DLG , mask) || -test_bit (RCA4_TYPE_MASK_FILE_LAYOUT , mask) || -test_bit (RCA4_TYPE_MASK_BLK_LAYOUT , mask)) -return true;fs/nfs/callback_proc.c out_putclient: · line 667
Quoted 10 lines
fs/nfs/callback_proc.c +1
-9-for (i =RCA4_TYPE_MASK_OBJ_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OBJ_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -for (i =RCA4_TYPE_MASK_OTHER_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OTHER_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -return false; +return mask & ~RCA4_TYPE_MASK_ALL ;Hmm, shouldn't that be
return (mask & ~RCA4_TYPE_MASK_ALL) == 0;Benny
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Yes, you are right.
OK. This is fixed in my branch to be released asap.
Thanks. I have a bunch more minor code cleanups that I'll send once I see what you have, unless you want them immediately. I'll also have a rebase of the pnfs-submit branch with the wave2 patches pushed down to the bottom shortly after I see your branch.
I prefer that you send them now.
OK, I'll send them in a few minutes.
Quoted 36 lines
Quoted 19 lines
Quoted 10 lines
I've reverted large parts of this patchset in the post-submit stream to restore layoutcommit and layoutreturn, but not their embedding in the CLOSE compound. I also kept the cleanups and bug fixes. I'll send out the post-submit when it's ready.
Some more work will be required to restore the original patches author and signoffees.This is the list as of now:
Quoted 8 lines
pick af44531 Revert "pnfs-submit: wave2: remove forgotten layoutreturn struct definitions" pick c465549 Revert "pnfs-submit: Turn off layoutcommits"
pick 0f4ba67 Revert "pnfs-submit: wave2: remove all LAYOUTRETURN code"
pick 486db47 Revert "pnfs-submit: wave2: Remove LAYOUTRETURN from return on close"pick 484c935 FIXME: roc should return layout on last close (This patch just adds a FIXME comment.)
Quoted 8 lines
The above looks good.
Quoted 3 lines
pick 8698772 Revert "pnfs-submit: wave2: remove
cl_layoutrecallslist" pick 263879b Revert "pnfs-submit: wave2: Pull out all recall initiated LAYOUTRETURNS" pick 693765f Revert "pnfs-submit: wave2: Don't wait in layoutget"Just note the Trond was highly resistant to the above.
I understand that in the forgetful client model but eventually returning the layout on close will be more efficient overall vs. having the server poll the client.
Quoted 4 lines
Quoted 2 lines
pick de56e11 Revert "pnfs-submit: wave2: check that partial LAYOUTGET return is ignored"
We need some sort of check that we got what we asked for, given that the xdr code can chop the servers reply.
Quoted 7 lines
The post-submit world is supposed to handle partial layouts correctly, as this is required for the obj and block layouts so we can't just blindly toss away partial layouts.
If the files layout driver won't support partial layouts we can restrict this (sigh, ugly) only for it.
Benny
Note the problem right now is that the xdr decoding function will only parse the first array element, and toss the rest. That is the real reason for the check, and something that needs to be fixed.
Fred
Quoted 30 lines
Quoted 30 lines
Fred
Quoted 25 lines
Anything else you had in mind?
Benny
Quoted 21 lines
Fred
Quoted 6 lines
Quoted 6 lines
fs/nfs/callback_proc.c +0
-0} __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,@@ -702,8 +684,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR));Quoted 7 lines
fs/nfs/callback_proc.c __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, · line 690
Quoted 7 lines
fs/nfs/callback_proc.c +1
-2status =cpu_to_be32 (NFS4ERR_INVAL ); -if (!validate_bitmap_values ((const unsigned long *) - &args->craa_type_mask)) +if (!validate_bitmap_values (args->craa_type_mask)) goto out; status =cpu_to_be32 (NFS4_OK );--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 12/22] pnfs-submit: wave2: rewrite validate_bitmap_values to obey spec
Quoted 78 lines · Fred Isaman
Quoted 75 lines · Benny Halevy
Quoted 74 lines · Fred Isaman
Quoted 71 lines · Benny Halevy
Quoted 69 lines · Fred Isaman
Quoted 60 lines · Benny Halevy
Quoted 47 lines · Fred Isaman
It was checking that at least one known bit was set. It needs to check no unknown bit was set. From RFC5661, section 20.6.3:
When a bit is set in the type mask that corresponds to an undefined type of recallable object,
NFS4ERR_INVALMUST be returned.Signed-off-by Fred Isaman <[email protected]>---
fs/nfs/callback.h| 1 +fs/nfs/callback_proc.c| 27 ++++-----------------------2 files changed, 5 insertions(+), 23 deletions(-)fs/nfs/callback.h +1
-0@@ -126,6 +126,7 @@ extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 +#define RCA4_TYPE_MASK_ALL 0xf31fstruct cb_recallanyargs {struct sockaddr *craa_addr;fs/nfs/callback_proc.c +2
-12@@ -661,28 +661,10 @@ out_putclient: goto out; } -static inline bool -validate_bitmap_values (const unsigned long *mask) +static bool +validate_bitmap_values (unsigned long mask) { -int i; - -if (*mask ==0 ) -return true; -if (test_bit (RCA4_TYPE_MASK_RDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_WDATA_DLG , mask) || -test_bit (RCA4_TYPE_MASK_DIR_DLG , mask) || -test_bit (RCA4_TYPE_MASK_FILE_LAYOUT , mask) || -test_bit (RCA4_TYPE_MASK_BLK_LAYOUT , mask)) -return true;fs/nfs/callback_proc.c out_putclient: · line 667
Quoted 10 lines
fs/nfs/callback_proc.c +1
-9-for (i =RCA4_TYPE_MASK_OBJ_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OBJ_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -for (i =RCA4_TYPE_MASK_OTHER_LAYOUT_MIN ; - i <=RCA4_TYPE_MASK_OTHER_LAYOUT_MAX ; i++) -if (test_bit (i, mask)) -return true; -return false; +return mask & ~RCA4_TYPE_MASK_ALL ;Hmm, shouldn't that be
Quoted 4 lines
return (mask & ~RCA4_TYPE_MASK_ALL) == 0;Benny
Yes, you are right.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
OK. This is fixed in my branch to be released asap.
Thanks. I have a bunch more minor code cleanups that I'll send once I see what you have, unless you want them immediately. I'll also have a rebase of the pnfs-submit branch with the wave2 patches pushed down to the bottom shortly after I see your branch.
I prefer that you send them now.
OK, I'll send them in a few minutes.
Thanks. Got 'em.
Quoted 39 lines
Quoted 39 lines
Quoted 19 lines
Quoted 10 lines
I've reverted large parts of this patchset in the post-submit stream to restore layoutcommit and layoutreturn, but not their embedding in the CLOSE compound. I also kept the cleanups and bug fixes. I'll send out the post-submit when it's ready.
Some more work will be required to restore the original patches author and signoffees.This is the list as of now:
Quoted 8 lines
pick af44531 Revert "pnfs-submit: wave2: remove forgotten layoutreturn struct definitions" pick c465549 Revert "pnfs-submit: Turn off layoutcommits"
pick 0f4ba67 Revert "pnfs-submit: wave2: remove all LAYOUTRETURN code"
pick 486db47 Revert "pnfs-submit: wave2: Remove LAYOUTRETURN from return on close"pick 484c935 FIXME: roc should return layout on last close (This patch just adds a FIXME comment.)
Quoted 8 lines
The above looks good.
Quoted 3 lines
pick 8698772 Revert "pnfs-submit: wave2: remove
cl_layoutrecallslist" pick 263879b Revert "pnfs-submit: wave2: Pull out all recall initiated LAYOUTRETURNS" pick 693765f Revert "pnfs-submit: wave2: Don't wait in layoutget"Just note the Trond was highly resistant to the above.
I understand that in the forgetful client model but eventually returning the layout on close will be more efficient overall vs. having the server poll the client.
Quoted 4 lines
Quoted 2 lines
pick de56e11 Revert "pnfs-submit: wave2: check that partial LAYOUTGET return is ignored"
We need some sort of check that we got what we asked for, given that the xdr code can chop the servers reply.
The post-submit world is supposed to handle partial layouts correctly, as this is required for the obj and block layouts so we can't just blindly toss away partial layouts.
Quoted 7 lines
Quoted 4 lines
If the files layout driver won't support partial layouts we can restrict this (sigh, ugly) only for it.
Benny
Note the problem right now is that the xdr decoding function will only parse the first array element, and toss the rest. That is the real reason for the check, and something that needs to be fixed.
I agree we need to implement getting an array of lsegs in layoutget response but the problem with this solution is that it will ignore also partial layouts provided as a single array element. A (more common, I assume) case we need to support too :)
Benny
Quoted 33 lines
Fred
Quoted 30 lines
Quoted 30 lines
Fred
Quoted 25 lines
Anything else you had in mind?
Benny
Quoted 21 lines
Fred
Quoted 6 lines
Quoted 6 lines
fs/nfs/callback_proc.c +0
-0} __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,@@ -702,8 +684,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR));Quoted 7 lines
fs/nfs/callback_proc.c __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, · line 690
Quoted 7 lines
fs/nfs/callback_proc.c +1
-2status =cpu_to_be32 (NFS4ERR_INVAL ); -if (!validate_bitmap_values ((const unsigned long *) - &args->craa_type_mask)) +if (!validate_bitmap_values (args->craa_type_mask)) goto out; status =cpu_to_be32 (NFS4_OK );--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/22 pnfs-submit: wave2: check that partial LAYOUTGET return is ignored
In reply to Fred IsamanEither a bad server reply, or our ignoring of multiple array segments in a reply, can cause a reply to not meet our requirements. Ensure that we ignore such replies.
--- fs/nfs/pnfs.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
fs/nfs/pnfs.c +11 -0
@@ -909,6 +909,17 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)struct nfs_client *clp =NFS_SERVER (ino)->nfs_client;int status =0 ; +/* Verify we got what we asked for. +* Note that because the xdr parsing only accepts a single +* element array, this can fail even if the server is behaving +* correctly. +*/ +if (lgp->args.range.iomode > res->range.iomode || + res->range.offset !=0 || + res->range.length !=NFS4_MAX_UINT64 ) { + status = -EINVAL ; + goto out; + }/* Inject layout blob into I/O device driver */ lseg =NFS_SERVER (ino)->pnfs_curr_ld->alloc_lseg (lo, res);if (!lseg ||IS_ERR (lseg)) {
Signature · 1 line
1.7.2.1
PATCH 14/22 pnfs-submit: wave2: Don't wait in layoutget
In reply to Fred Isamaninstead, just go direct to MDS. This simplifies things a lot. The primary problem that initiated this is that plh_outstanding accounting was not correct, and there is no easy way to make it correct if it is incremented within layoutget_prepare (due to ctrl-c issues).
This patch basically does three things:
- remove the rpc waitqs
- push plh_outstanding accounting outside of the layoutget rpc code
- shift pnfs_layoutgets_blocked() up and make static
--- fs/nfs/callback_proc.c | 4 --- fs/nfs/client.c | 2 - fs/nfs/inode.c | 1 - fs/nfs/nfs4proc.c | 45 +-------------------------------- fs/nfs/pnfs.c | 59 +++++++++++++++++++++++--------------------- fs/nfs/pnfs.h | 1 - include/linux/nfs_fs.h | 1 - include/linux/nfs_fs_sb.h | 1 - 8 files changed, 33 insertions(+), 81 deletions(-)
fs/nfs/callback_proc.c +0 -4
@@ -224,7 +224,6 @@ void nfs_client_return_layouts(struct nfs_client *clp)list_del (&cb_info->pcl_list); clp->cl_cb_lrecall_count--; clp->cl_drain_notification[1 << cb_info->pcl_notify_bit] =NULL ; -rpc_wake_up (&clp->cl_rpcwaitq_recall);kfree (cb_info); } }
@@ -376,7 +375,6 @@ static u32 do_callback_layoutrecall(struct nfs_client *clp,list_del (&new->pcl_list); clp->cl_cb_lrecall_count--; clp->cl_drain_notification[1 << bit_num] =NULL ; -rpc_wake_up (&clp->cl_rpcwaitq_recall);spin_unlock (&clp->cl_lock);if (res ==NFS4_OK ) {if (args->cbl_recall_type ==RETURN_FILE ) {
@@ -385,8 +383,6 @@ static u32 do_callback_layoutrecall(struct nfs_client *clp, lo =NFS_I (new->pcl_ino)->layout;spin_lock (&lo->inode->i_lock); lo->plh_block_lgets--; -if (!pnfs_layoutgets_blocked (lo,NULL )) -rpc_wake_up (&NFS_I (lo->inode)->lo_rpcwaitq_stateid);spin_unlock (&lo->inode->i_lock);put_layout_hdr (new->pcl_ino); }
fs/nfs/client.c +0 -2
@@ -159,8 +159,6 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_#if defined(CONFIG_NFS_V4_1 )INIT_LIST_HEAD (&clp->cl_layouts);INIT_LIST_HEAD (&clp->cl_layoutrecalls); -rpc_init_wait_queue (&clp->cl_rpcwaitq_recall, -"NFS client CB_LAYOUTRECALLS" );#endif nfs_fscache_get_client_cookie (clp);
fs/nfs/inode.c +0 -1
@@ -1460,7 +1460,6 @@ static inline void nfs4_init_once(struct nfs_inode *nfsi) nfsi->delegation_state =0 ;init_rwsem (&nfsi->rwsem);rpc_init_wait_queue (&nfsi->lo_rpcwaitq,"pNFS Layoutreturn" ); -rpc_init_wait_queue (&nfsi->lo_rpcwaitq_stateid,"pNFS Layoutstateid" ); nfsi->layout =NULL ;#endif }
fs/nfs/nfs4proc.c +2 -43
78 lines not on this page · raw message
fs/nfs/pnfs.c +31 -28
145 lines not on this page · raw message
fs/nfs/pnfs.h +0 -1
@@ -214,7 +214,6 @@ enum pnfs_try_status pnfs_try_to_commit(struct nfs_write_data *,void pnfs_pageio_init_read (struct nfs_pageio_descriptor *,struct inode *,struct nfs_open_context *,struct list_head *);void pnfs_pageio_init_write (struct nfs_pageio_descriptor *,struct inode *); -bool pnfs_layoutgets_blocked (struct pnfs_layout_hdr *lo,nfs4_stateid *stateid);int pnfs_layout_process (struct nfs4_layoutget *lgp);void pnfs_free_lseg_list (struct list_head *tmp_list);void pnfs_destroy_layout (struct nfs_inode *);
include/linux/nfs_fs.h +0 -1
@@ -191,7 +191,6 @@ struct nfs_inode {/* pNFS layout information */ struct rpc_wait_queue lo_rpcwaitq; -struct rpc_wait_queue lo_rpcwaitq_stateid;struct pnfs_layout_hdr *layout;#endif /* CONFIG_NFS_V4*/ #ifdef CONFIG_NFS_FSCACHE
include/linux/nfs_fs_sb.h +0 -1
@@ -87,7 +87,6 @@ struct nfs_client {unsigned long cl_cb_lrecall_count;#define PNFS_MAX_CB_LRECALLS (64)atomic_t *cl_drain_notification[PNFS_MAX_CB_LRECALLS ]; -struct rpc_wait_queue cl_rpcwaitq_recall;struct pnfs_deviceid_cache *cl_devid_cache;/* pNFS deviceid cache */ #endif /* CONFIG_NFS_V4_1 */
Signature · 1 line
1.7.2.1
PATCH 15/22 pnfs-submit: wave2: Pull out all recall initiated LAYOUTRETURNS
In reply to Fred Isamanby removing state manager invocation. This also has the advantage that it avoids a current bug where we don't set an inode on bulk LAYOUTRETURNs, since we no longer send any.
--- fs/nfs/callback.h | 5 -- fs/nfs/callback_proc.c | 103 +++++++++++++---------------------------------- fs/nfs/nfs4_fs.h | 1 - fs/nfs/nfs4state.c | 4 -- 4 files changed, 29 insertions(+), 84 deletions(-)
fs/nfs/callback.h +0 -5
@@ -167,7 +167,6 @@ extern unsigned nfs4_callback_layoutrecall(extern bool matches_outstanding_recall (struct inode *ino,struct pnfs_layout_range *range);extern void notify_drained (struct nfs_client *clp,u64 mask); -extern void nfs_client_return_layouts (struct nfs_client *clp);static inline void put_session_client (struct nfs4_session *session) {
@@ -183,10 +182,6 @@ find_client_from_cps(struct cb_process_state *cps, struct sockaddr *addr)#else /* CONFIG_NFS_V4_1 */ -static inline void nfs_client_return_layouts (struct nfs_client *clp) -{ -} -static inline struct nfs_client *find_client_from_cps (struct cb_process_state *cps,struct sockaddr *addr) {
fs/nfs/callback_proc.c +29 -74
131 lines not on this page · raw message
fs/nfs/nfs4_fs.h +0 -1
@@ -46,7 +46,6 @@ enum nfs4_client_state {NFS4CLNT_DELEGRETURN ,NFS4CLNT_SESSION_RESET , NFS4CLNT_RECALL_SLOT, - NFS4CLNT_LAYOUT_RECALL, }; enum nfs4_session_state {
fs/nfs/nfs4state.c +0 -4
@@ -1576,10 +1576,6 @@ static void nfs4_state_manager(struct nfs_client *clp)nfs_client_return_marked_delegations (clp);continue ; } -if (test_and_clear_bit (NFS4CLNT_LAYOUT_RECALL , &clp->cl_state)) { -nfs_client_return_layouts (clp); -continue ; - }/* Recall session slots */ if (test_and_clear_bit (NFS4CLNT_RECALL_SLOT , &clp->cl_state) &&nfs4_has_session (clp)) {
Signature · 1 line
1.7.2.1
PATCH 16/22 pnfs-submit: wave2: remove cl_layoutrecalls list
In reply to Fred IsamanTrond points out that, given the restriction that bulk recalls must be serialized, and the fact that the DELAY response we send does not obligate us to any of the restrictions that an OK response would, we don't really need another per-client list and the locking complications it incurs.
This patch:
- removes cl_layoutrecalls
- removes struct pnfs_cb_lrecall_info, used as entries in cl_layoutrecalls
- removes _recall_matches_lget, insetead relying on bit tests
- changes notification code, it is now used only to make NOMATCH/DELAY decision as late as possible
- add trigger_flush function
--- fs/nfs/callback.h | 9 ++- fs/nfs/callback_proc.c | 167 +++++++------------------------------------- fs/nfs/client.c | 1 - fs/nfs/nfs4_fs.h | 1 + fs/nfs/nfs4proc.c | 9 +-- fs/nfs/pnfs.c | 42 +++++------- fs/nfs/pnfs.h | 12 +--- include/linux/nfs_fs_sb.h | 5 +- 8 files changed, 55 insertions(+), 191 deletions(-)
fs/nfs/callback.h +6 -3
@@ -154,6 +154,7 @@ struct cb_layoutrecallargs {union {struct {struct nfs_fh cbl_fh; +struct inode *cbl_inode;struct pnfs_layout_range cbl_range;nfs4_stateid cbl_stateid; };
@@ -164,9 +165,11 @@ struct cb_layoutrecallargs {extern unsigned nfs4_callback_layoutrecall (struct cb_layoutrecallargs *args,void *dummy,struct cb_process_state *cps); -extern bool matches_outstanding_recall (struct inode *ino, -struct pnfs_layout_range *range); -extern void notify_drained (struct nfs_client *clp,u64 mask); + +static inline void notify_drained (struct nfs_client *clp,int count) +{ +atomic_sub (count, &clp->cl_drain_notify); +}static inline void put_session_client (struct nfs4_session *session) {
fs/nfs/callback_proc.c +27 -140
236 lines not on this page · raw message
fs/nfs/client.c +0 -1
@@ -158,7 +158,6 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_ clp->cl_machine_cred = cred;#if defined(CONFIG_NFS_V4_1 )INIT_LIST_HEAD (&clp->cl_layouts); -INIT_LIST_HEAD (&clp->cl_layoutrecalls);#endif nfs_fscache_get_client_cookie (clp);
fs/nfs/nfs4_fs.h +1 -0
@@ -44,6 +44,7 @@ enum nfs4_client_state {NFS4CLNT_RECLAIM_REBOOT ,NFS4CLNT_RECLAIM_NOGRACE ,NFS4CLNT_DELEGRETURN , +NFS4CLNT_LAYOUTRECALL ,NFS4CLNT_SESSION_RESET , NFS4CLNT_RECALL_SLOT, };
fs/nfs/nfs4proc.c +1 -8
@@ -5378,14 +5378,8 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)dprintk ("--> %s\n" , __func__); -if (!nfs4_sequence_done (task, &lgp->res.seq_res)) { -/* layout code relies on fact that in this case -* code falls back to tk_action=call_start, but not -* back to rpc_prepare_task, to keep plh_outstanding -* correct. -*/ +if (!nfs4_sequence_done (task, &lgp->res.seq_res))return ; - }switch (task->tk_status) {case 0 :break ;
@@ -5408,7 +5402,6 @@ static void nfs4_layoutget_release(void *calldata)struct nfs4_layoutget *lgp = calldata;dprintk ("--> %s\n" , __func__); -put_layout_hdr (lgp->args.inode);if (lgp->res.layout.buf !=NULL )free_page ((unsigned long ) lgp->res.layout.buf);put_nfs_open_context (lgp->args.ctx);
fs/nfs/pnfs.c +18 -24
115 lines not on this page · raw message
fs/nfs/pnfs.h +1 -11
@@ -39,7 +39,7 @@ struct pnfs_layout_segment {atomic_t pls_refcount;bool valid;struct pnfs_layout_hdr *layout; -u64 pls_notify_mask; +int pls_notify_count; };enum pnfs_try_status {
@@ -123,15 +123,6 @@ struct pnfs_device {unsigned int pglen; }; -struct pnfs_cb_lrecall_info { -struct list_head pcl_list;/* hook into cl_layoutrecalls list */ -atomic_t pcl_count; -int pcl_notify_bit; -struct nfs_client *pcl_clp; -struct inode *pcl_ino; -struct cb_layoutrecallargs pcl_args; -}; -/* * Device ID RCU cache. A device ID is unique per client ID and layout type. */
@@ -227,7 +218,6 @@ int pnfs_choose_layoutget_stateid(nfs4_stateid *dst, struct nfs4_state *open_state);void nfs4_asynch_forget_layouts (struct pnfs_layout_hdr *lo,struct pnfs_layout_range *range, -int notify_bit,atomic_t *notify_count,struct list_head *tmp_list); static inline bool
include/linux/nfs_fs_sb.h +1 -4
@@ -83,10 +83,7 @@ struct nfs_client {u32 cl_exchange_flags;struct nfs4_session *cl_session;/* sharred session */ struct list_head cl_layouts; -struct list_head cl_layoutrecalls; -unsigned long cl_cb_lrecall_count; -#define PNFS_MAX_CB_LRECALLS (64) -atomic_t *cl_drain_notification[PNFS_MAX_CB_LRECALLS ]; +atomic_t cl_drain_notify;struct pnfs_deviceid_cache *cl_devid_cache;/* pNFS deviceid cache */ #endif /* CONFIG_NFS_V4_1 */
Signature · 1 line
1.7.2.1
PATCH 17/22 pnfs-submit: wave2: change plh_outstanding to atomic_t
In reply to Fred Isaman--- fs/nfs/nfs4proc.c | 4 ++-- fs/nfs/pnfs.c | 11 ++++++----- fs/nfs/pnfs.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-)
fs/nfs/nfs4proc.c +2 -2
@@ -5607,7 +5607,7 @@ static void nfs4_layoutreturn_release(void *calldata)spin_lock (&ino->i_lock); lo->plh_block_lgets--; - lo->plh_outstanding--; +atomic_dec (&lo->plh_outstanding);spin_unlock (&ino->i_lock);put_layout_hdr (ino); }
@@ -5644,7 +5644,7 @@ int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, bool issync)/* FIXME we should test for BULK here */ spin_lock (&lo->inode->i_lock);BUG_ON (lo->plh_block_lgets ==0 ); - lo->plh_outstanding++; +atomic_inc (&lo->plh_outstanding);spin_unlock (&lo->inode->i_lock); } task =rpc_run_task (&task_setup_data);
fs/nfs/pnfs.c +6 -5
@@ -505,7 +505,8 @@ pnfs_layoutgets_blocked(struct pnfs_layout_hdr *lo, nfs4_stateid *stateid,return true;return lo->plh_block_lgets ||test_bit (NFS_LAYOUT_BULK_RECALL , &lo->plh_flags) || - (list_empty (&lo->segs) && (lo->plh_outstanding > lget)); + (list_empty (&lo->segs) && + (atomic_read (&lo->plh_outstanding) > lget)); }int
@@ -868,7 +869,7 @@ pnfs_update_layout(struct inode *ino,if (pnfs_layoutgets_blocked (lo,NULL ,0 )) goto out_unlock; - lo->plh_outstanding++; +atomic_inc (&lo->plh_outstanding);get_layout_hdr (lo);/* Matched in pnfs_layoutget_release */ if (list_empty (&lo->segs)) {
@@ -883,18 +884,18 @@ pnfs_update_layout(struct inode *ino,spin_unlock (&ino->i_lock); lseg =send_layoutget (lo, ctx, &arg); -spin_lock (&ino->i_lock);if (!lseg) { +spin_lock (&ino->i_lock);if (list_empty (&lo->segs)) {spin_lock (&clp->cl_lock);list_del_init (&lo->layouts);spin_unlock (&clp->cl_lock);clear_bit (NFS_LAYOUT_BULK_RECALL , &lo->plh_flags); } +spin_unlock (&ino->i_lock); } - lo->plh_outstanding--; +atomic_dec (&lo->plh_outstanding);put_layout_hdr (ino); -spin_unlock (&ino->i_lock); out:dprintk ("%s end, state 0x%lx lseg %p\n" , __func__, nfsi->layout->plh_flags, lseg);
fs/nfs/pnfs.h +1 -1
@@ -100,7 +100,7 @@ struct pnfs_layout_hdr {struct list_head segs;/* layout segments list */ int roc_iomode;/* return on close iomode, 0=none */ nfs4_stateid stateid; -unsigned long plh_outstanding;/* number of RPCs out */ +atomic_t plh_outstanding;/* number of RPCs out */ unsigned long plh_block_lgets;/* block LAYOUTGET if >0 */ u32 plh_barrier;/* ignore lower seqids */ unsigned long plh_flags;
Signature · 1 line
1.7.2.1
PATCH 18/22 pnfs-submit: wave2: change lseg->valid from bool to a bit flag
In reply to Fred IsamanThis makes way for adding roc bit to lseg
--- fs/nfs/pnfs.c | 18 ++++++++++-------- fs/nfs/pnfs.h | 6 +++++- 2 files changed, 15 insertions(+), 9 deletions(-)
fs/nfs/pnfs.c +10 -8
@@ -276,7 +276,7 @@ init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg)INIT_LIST_HEAD (&lseg->fi_list);atomic_set (&lseg->pls_refcount,1 );smp_mb (); - lseg->valid = true; +set_bit (NFS_LSEG_VALID , &lseg->pls_flags); lseg->layout = lo; lseg->pls_notify_count =0 ; }
@@ -286,7 +286,7 @@ _put_lseg_common(struct pnfs_layout_segment *lseg) {struct inode *ino = lseg->layout->inode; -BUG_ON (lseg->valid == true); +BUG_ON (test_bit (NFS_LSEG_VALID , &lseg->pls_flags));list_del (&lseg->fi_list);if (list_empty (&lseg->layout->segs)) {struct nfs_client *clp;
@@ -309,7 +309,8 @@ put_lseg_locked(struct pnfs_layout_segment *lseg, struct list_head *tmp_list) {dprintk ("%s: lseg %p ref %d valid %d\n" , __func__, lseg, -atomic_read (&lseg->pls_refcount), lseg->valid); +atomic_read (&lseg->pls_refcount), +test_bit (NFS_LSEG_VALID , &lseg->pls_flags));if (atomic_dec_and_test (&lseg->pls_refcount)) {_put_lseg_common (lseg);list_add (&lseg->fi_list, tmp_list);
@@ -325,7 +326,8 @@ put_lseg(struct pnfs_layout_segment *lseg)return ;dprintk ("%s: lseg %p ref %d valid %d\n" , __func__, lseg, -atomic_read (&lseg->pls_refcount), lseg->valid); +atomic_read (&lseg->pls_refcount), +test_bit (NFS_LSEG_VALID , &lseg->pls_flags)); ino = lseg->layout->inode;if (atomic_dec_and_lock (&lseg->pls_refcount, &ino->i_lock)) {int count = lseg->pls_notify_count;
@@ -363,8 +365,7 @@ static void mark_lseg_invalid(struct pnfs_layout_segment *lseg, struct list_head *tmp_list) {assert_spin_locked (&lseg->layout->inode->i_lock); -if (lseg->valid) { - lseg->valid = false; +if (test_and_clear_bit (NFS_LSEG_VALID , &lseg->pls_flags)) {/* Remove the reference keeping the lseg in the * list. It will now be removed when all * outstanding io is finished.
@@ -809,7 +810,8 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,assert_spin_locked (&lo->inode->i_lock);list_for_each_entry (lseg, &lo->segs, fi_list) { -if (lseg->valid &&is_matching_lseg (lseg, range)) { +if (test_bit (NFS_LSEG_VALID , &lseg->pls_flags) && +is_matching_lseg (lseg, range)) {get_lseg (lseg); ret = lseg;break ;
@@ -820,7 +822,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,dprintk ("%s:Return lseg %p ref %d valid %d\n" , __func__, ret, ret ?atomic_read (&ret->pls_refcount) :0 , - ret ? ret->valid :0 ); + ret ?test_bit (NFS_LSEG_VALID , &ret->pls_flags) :0 );return ret; }
fs/nfs/pnfs.h +5 -1
@@ -33,11 +33,15 @@#include <linux/nfs_page.h> #include "callback.h" /* for cb_layoutrecallargs */ +enum { +NFS_LSEG_VALID =0 ,/* cleared when lseg is recalled/returned */ +}; +struct pnfs_layout_segment {struct list_head fi_list;struct pnfs_layout_range range;atomic_t pls_refcount; -bool valid; +unsigned long pls_flags;struct pnfs_layout_hdr *layout;int pls_notify_count; };
Signature · 1 line
1.7.2.1
PATCH 19/22 pnfs-submit: wave2: Remove LAYOUTRETURN from return on close
In reply to Fred Isamanremove explicit LAYOUTRETURN call before CLOSE
ensure draining of io and forgetting of layouts marked roc before CLOSE update barrier on return from CLOSE
--- fs/nfs/nfs4_fs.h | 2 +- fs/nfs/nfs4proc.c | 14 ++++++- fs/nfs/nfs4state.c | 16 +------- fs/nfs/pnfs.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++---- fs/nfs/pnfs.h | 38 +++++++++++++------ 5 files changed, 134 insertions(+), 37 deletions(-)
fs/nfs/nfs4_fs.h +1 -1
@@ -242,7 +242,7 @@ extern int nfs4_proc_async_renew(struct nfs_client *, struct rpc_cred *);extern int nfs4_proc_renew (struct nfs_client *,struct rpc_cred *);extern int nfs4_init_clientid (struct nfs_client *,struct rpc_cred *);extern int nfs41_init_clientid (struct nfs_client *,struct rpc_cred *); -extern int nfs4_do_close (struct path *path,struct nfs4_state *state,gfp_t gfp_mask,int wait); +extern int nfs4_do_close (struct path *path,struct nfs4_state *state,gfp_t gfp_mask,int wait,bool roc);extern int nfs4_server_capabilities (struct nfs_server *server,struct nfs_fh *fhandle);extern int nfs4_proc_fs_locations (struct inode *dir,const struct qstr *name,struct nfs4_fs_locations *fs_locations,struct page *page);
fs/nfs/nfs4proc.c +12 -2
@@ -1841,6 +1841,8 @@ struct nfs4_closedata {struct nfs_closeres res;struct nfs_fattr fattr;unsigned long timestamp; +bool roc; +u32 roc_barrier; };static void nfs4_free_closedata (void *data)
@@ -1848,6 +1850,7 @@ static void nfs4_free_closedata(void *data)struct nfs4_closedata *calldata = data;struct nfs4_state_owner *sp = calldata->state->owner; +pnfs_roc_release (calldata->roc, calldata->state->inode);nfs4_put_open_state (calldata->state);nfs_free_seqid (calldata->arg.seqid);nfs4_put_state_owner (sp);
@@ -1880,6 +1883,8 @@ static void nfs4_close_done(struct rpc_task *task, void *data)*/ switch (task->tk_status) {case 0 : +pnfs_roc_set_barrier (calldata->roc, state->inode, + calldata->roc_barrier);nfs_set_open_stateid (state, &calldata->res.stateid,0 );renew_lease (server, calldata->timestamp); nfs4_close_clear_stateid_flags(state,
@@ -1932,8 +1937,11 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)return ; } -if (calldata->arg.fmode ==0 ) +if (calldata->arg.fmode ==0 ) { task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE ]; +pnfs_roc_drain (calldata->roc, state->inode, + &calldata->roc_barrier, task); + }nfs_fattr_init (calldata->res.fattr); calldata->timestamp = jiffies;
@@ -1961,7 +1969,7 @@ static const struct rpc_call_ops nfs4_close_ops = {* * NOTE: Caller must be holding the sp->so_owner semaphore! */ -int nfs4_do_close (struct path *path,struct nfs4_state *state,gfp_t gfp_mask,int wait) +int nfs4_do_close (struct path *path,struct nfs4_state *state,gfp_t gfp_mask,int wait,bool roc) {struct nfs_server *server =NFS_SERVER (state->inode);struct nfs4_closedata *calldata;
@@ -1996,6 +2004,7 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, gfp_t gfp_mask, i calldata->res.fattr = &calldata->fattr; calldata->res.seqid = calldata->arg.seqid; calldata->res.server = server; + calldata->roc = roc;path_get (path); calldata->path = *path;
@@ -2013,6 +2022,7 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, gfp_t gfp_mask, i out_free_calldata:kfree (calldata); out: +pnfs_roc_release (roc, state->inode);nfs4_put_open_state (state);nfs4_put_state_owner (sp);return status;
fs/nfs/nfs4state.c +2 -14
@@ -619,21 +619,9 @@ static void __nfs4_close(struct path *path, struct nfs4_state *state,nfs4_put_open_state (state);nfs4_put_state_owner (owner); }else { -u32 roc_iomode; -struct nfs_inode *nfsi =NFS_I (state->inode); - -if (has_layout (nfsi) && - (roc_iomode =pnfs_layout_roc_iomode (nfsi)) !=0 ) { -struct pnfs_layout_range range = { - .iomode = roc_iomode, - .offset =0 , - .length =NFS4_MAX_UINT64 , - }; - -pnfs_return_layout (state->inode, &range, wait); - } +bool roc =pnfs_roc (state->inode); -nfs4_do_close (path, state, gfp_mask, wait); +nfs4_do_close (path, state, gfp_mask, wait, roc); } }
fs/nfs/pnfs.c +93 -8
119 lines not on this page · raw message
fs/nfs/pnfs.h +26 -12
@@ -35,6 +35,7 @@enum {NFS_LSEG_VALID =0 ,/* cleared when lseg is recalled/returned */ +NFS_LSEG_ROC ,/* roc bit received from server */ };struct pnfs_layout_segment {
@@ -60,6 +61,7 @@ enum {NFS_LAYOUT_RW_FAILED ,/* get rw layout failed stop trying */ NFS_LAYOUT_BULK_RECALL ,/* bulk recall affecting layout */ NFS_LAYOUT_NEED_LCOMMIT ,/* LAYOUTCOMMIT needed */ + NFS_LAYOUT_ROC, /* some lseg had roc bit set */ };/* Per-layout driver specific registration structure */
@@ -102,7 +104,6 @@ struct pnfs_layout_hdr {struct list_head layouts;/* other client layouts */ struct list_head plh_bulk_recall;/* clnt list of bulk recalls */ struct list_head segs;/* layout segments list */ -int roc_iomode;/* return on close iomode, 0=none */ nfs4_stateid stateid;atomic_t plh_outstanding;/* number of RPCs out */ unsigned long plh_block_lgets;/* block LAYOUTGET if >0 */
@@ -223,6 +224,11 @@ int pnfs_choose_layoutget_stateid(nfs4_stateid *dst,void nfs4_asynch_forget_layouts (struct pnfs_layout_hdr *lo,struct pnfs_layout_range *range,struct list_head *tmp_list); +bool pnfs_roc (struct inode *ino); +void pnfs_roc_release (bool needed,struct inode *ino); +void pnfs_roc_set_barrier (bool needed,struct inode *ino,u32 barrier); +void pnfs_roc_drain (bool needed,struct inode *ino,u32 *barrier, +struct rpc_task *task);static inline bool has_layout (struct nfs_inode *nfsi)
@@ -248,14 +254,6 @@ static inline int pnfs_enabled_sb(struct nfs_server *nfss)return nfss->pnfs_curr_ld !=NULL ; } -/* Should the pNFS client commit and return the layout on close -*/ -static inline int -pnfs_layout_roc_iomode (struct nfs_inode *nfsi) -{ -return nfsi->layout->roc_iomode; -} -static inline int pnfs_return_layout (struct inode *ino,struct pnfs_layout_range *range,bool wait)
@@ -345,10 +343,26 @@ pnfs_ld_layoutret_on_setattr(struct inode *inode)return false; } -static inline int -pnfs_layout_roc_iomode (struct nfs_inode *nfsi) +static inline bool +pnfs_roc (struct inode *ino) +{ +return false; +} + +static inline void +pnfs_roc_release (bool needed,struct inode *ino) +{ +} + +static inline void +pnfs_roc_set_barrier (bool needed,struct inode *ino,u32 barrier) +{ +} + +static inline void +pnfs_roc_drain (bool needed,struct inode *ino,u32 *barrier, +struct rpc_task *task) { -return 0 ; } static inline int pnfs_return_layout(struct inode *ino,
Signature · 1 line
1.7.2.1
PATCH 20/22 pnfs-submit: wave2: remove all LAYOUTRETURN code
In reply to Fred Isamanremove boilerplate nfs4proc and nfs4xdr codepnfs_return_layout is only called by evict_inode. Just have it forget everything
--- fs/nfs/nfs4proc.c | 118 ----------------------------------------------------- fs/nfs/nfs4xdr.c | 111 ------------------------------------------------- fs/nfs/pnfs.c | 62 +--------------------------- fs/nfs/pnfs.h | 2 - 4 files changed, 1 insertions(+), 292 deletions(-)
fs/nfs/nfs4proc.c +0 -118
@@ -5554,124 +5554,6 @@ out:return 0 ; } -static void -nfs4_layoutreturn_prepare (struct rpc_task *task,void *calldata) -{ -struct nfs4_layoutreturn *lrp = calldata; - -dprintk ("--> %s\n" , __func__); -if (lrp->args.return_type ==RETURN_FILE ) { -struct nfs_inode *nfsi =NFS_I (lrp->args.inode); - -if (pnfs_return_layout_barrier (nfsi, &lrp->args.range)) { -dprintk ("%s: waiting on barrier\n" , __func__); -rpc_sleep_on (&nfsi->lo_rpcwaitq, task,NULL ); -return ; - } - } -if (nfs41_setup_sequence (lrp->clp->cl_session, &lrp->args.seq_args, - &lrp->res.seq_res,0 , task)) -return ; -rpc_call_start (task); -} - -static void nfs4_layoutreturn_done (struct rpc_task *task,void *calldata) -{ -struct nfs4_layoutreturn *lrp = calldata; -struct nfs_server *server; - -dprintk ("--> %s\n" , __func__); - -if (!nfs4_sequence_done (task, &lrp->res.seq_res)) -return ; - -if (lrp->args.return_type ==RETURN_FILE ) - server =NFS_SERVER (lrp->args.inode); -else - server =NULL ; -if (nfs4_async_handle_error (task, server,NULL , lrp->clp) == -EAGAIN ) { -nfs_restart_rpc (task, lrp->clp); -return ; - } -if ((task->tk_status ==0 ) && (lrp->args.return_type ==RETURN_FILE )) { -struct pnfs_layout_hdr *lo =NFS_I (lrp->args.inode)->layout; - -spin_lock (&lo->inode->i_lock); -if (lrp->res.lrs_present) -pnfs_set_layout_stateid (lo, &lrp->res.stateid, true); -else -BUG_ON (!list_empty (&lo->segs)); -spin_unlock (&lo->inode->i_lock); - } -dprintk ("<-- %s\n" , __func__); -} - -static void nfs4_layoutreturn_release (void *calldata) -{ -struct nfs4_layoutreturn *lrp = calldata; - -dprintk ("--> %s return_type %d\n" , __func__, lrp->args.return_type); -if (lrp->args.return_type ==RETURN_FILE ) { -struct inode *ino = lrp->args.inode; -struct pnfs_layout_hdr *lo =NFS_I (ino)->layout; - -spin_lock (&ino->i_lock); - lo->plh_block_lgets--; -atomic_dec (&lo->plh_outstanding); -spin_unlock (&ino->i_lock); -put_layout_hdr (ino); - } -kfree (calldata); -dprintk ("<-- %s\n" , __func__); -} - -static const struct rpc_call_ops nfs4_layoutreturn_call_ops = { - .rpc_call_prepare = nfs4_layoutreturn_prepare, - .rpc_call_done = nfs4_layoutreturn_done, - .rpc_release = nfs4_layoutreturn_release, -}; - -int nfs4_proc_layoutreturn (struct nfs4_layoutreturn *lrp,bool issync) -{ -struct rpc_task *task; -struct rpc_message msg = { - .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTRETURN ], - .rpc_argp = &lrp->args, - .rpc_resp = &lrp->res, - }; -struct rpc_task_setup task_setup_data = { - .rpc_client = lrp->clp->cl_rpcclient, - .rpc_message = &msg, - .callback_ops = &nfs4_layoutreturn_call_ops, - .callback_data = lrp, - .flags =RPC_TASK_ASYNC , - }; -int status =0 ; - -dprintk ("--> %s\n" , __func__); -if (lrp->args.return_type ==RETURN_FILE ) { -struct pnfs_layout_hdr *lo =NFS_I (lrp->args.inode)->layout; -/* FIXME we should test for BULK here */ -spin_lock (&lo->inode->i_lock); -BUG_ON (lo->plh_block_lgets ==0 ); -atomic_inc (&lo->plh_outstanding); -spin_unlock (&lo->inode->i_lock); - } - task =rpc_run_task (&task_setup_data); -if (IS_ERR (task)) -return PTR_ERR (task); -if (!issync) - goto out; - status =nfs4_wait_for_completion_rpc_task (task); -if (status !=0 ) - goto out; - status = task->tk_status; -out: -dprintk ("<-- %s\n" , __func__); -rpc_put_task (task); -return status; -} -static int _nfs4_proc_getdeviceinfo (struct nfs_server *server,struct pnfs_device *pdev) {
fs/nfs/nfs4xdr.c +0 -111
153 lines not on this page · raw message
fs/nfs/pnfs.c +1 -61
77 lines not on this page · raw message
fs/nfs/pnfs.h +0 -2
@@ -183,7 +183,6 @@ extern int nfs4_proc_getdeviceinfo(struct nfs_server *server,extern int nfs4_proc_layoutget (struct nfs4_layoutget *lgp);extern int nfs4_proc_layoutcommit (struct nfs4_layoutcommit_data *data,int issync); -extern int nfs4_proc_layoutreturn (struct nfs4_layoutreturn *lrp,bool wait);/* pnfs.c */ void get_layout_hdr (struct pnfs_layout_hdr *lo);
@@ -193,7 +192,6 @@ bool should_free_lseg(struct pnfs_layout_range *lseg_range,struct pnfs_layout_segment *pnfs_update_layout (struct inode *ino,struct nfs_open_context *ctx,enum pnfs_iomode access_type); -bool pnfs_return_layout_barrier (struct nfs_inode *,struct pnfs_layout_range *);int _pnfs_return_layout (struct inode *,struct pnfs_layout_range *,bool wait);void set_pnfs_layoutdriver (struct nfs_server *,u32 id);void unset_pnfs_layoutdriver (struct nfs_server *);
Signature · 1 line
1.7.2.1
Re: [PATCH 20/22] pnfs-submit: wave2: remove all LAYOUTRETURN code
Quoted 67 lines · Fred Isaman
fs/nfs/pnfs.c +0
-51@@ -599,55 +599,6 @@ void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo, } } -/* Return true if there is layout based io in progress in the given range. -* Assumes range has already been marked invalid, and layout marked to -* prevent any new lseg from being inserted. -*/ -bool -pnfs_return_layout_barrier (struct nfs_inode *nfsi, -struct pnfs_layout_range *range) -{ -struct pnfs_layout_segment *lseg; -bool ret = false; - -spin_lock (&nfsi->vfs_inode.i_lock); -list_for_each_entry (lseg, &nfsi->layout->segs, fi_list) -if (should_free_lseg (&lseg->range, range)) { - ret = true; -break ; - } -spin_unlock (&nfsi->vfs_inode.i_lock); -dprintk ("%s:Return %d\n" , __func__, ret); -return ret; -} - -static int -return_layout (struct inode *ino,struct pnfs_layout_range *range,bool wait) -{ -struct nfs4_layoutreturn *lrp; -struct nfs_server *server =NFS_SERVER (ino); -int status = -ENOMEM ; - -dprintk ("--> %s\n" , __func__); - - lrp =kzalloc (sizeof (*lrp),GFP_KERNEL ); -if (lrp ==NULL ) { -put_layout_hdr (ino); - goto out; - } - lrp->args.reclaim =0 ; - lrp->args.layout_type = server->pnfs_curr_ld->id; - lrp->args.return_type =RETURN_FILE ; - lrp->args.range = *range; - lrp->args.inode = ino; - lrp->clp = server->nfs_client; - - status =nfs4_proc_layoutreturn (lrp, wait); -out: -dprintk ("<-- %s status: %d\n" , __func__, status); -return status; -} -/* Initiates a LAYOUTRETURN(FILE) */ int _pnfs_return_layout(struct inode *ino, struct pnfs_layout_range *range,@@ -673,21 +624,10 @@ _pnfs_return_layout(struct inode *ino, struct pnfs_layout_range *range, goto out; } lo->plh_block_lgets++; -/* Reference matched in nfs4_layoutreturn_release */ -get_layout_hdr (lo);spin_unlock (&ino->i_lock);pnfs_free_lseg_list (&tmp_list);
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct pnfs_layout_range *range, · line 690
Quoted 10 lines
fs/nfs/pnfs.c +0
-10-if (layoutcommit_needed (nfsi)) { - status =pnfs_layoutcommit_inode (ino, wait); -if (status) { -/* Return layout even if layoutcommit fails */ -dprintk ("%s: layoutcommit failed, status=%d. " -"Returning layout anyway\n" , - __func__, status); - } - } - status =return_layout (ino, &arg, wait);
You are also removing the layoutcommit.
1. You have not stated it anywhere, and snacked it in silently
2. If you are removing layoutcommit please do that in a different patch with it's own comment and explanation.
3. How come? forgetful or not layoutcommits are a different issue and must be done correctly when writing !!!?!
Boaz
Quoted 24 lines
fs/nfs/pnfs.c +1
-0+/* Don't need to wait since this is followed by call to end_writeback */ out:dprintk ("<-- %s status: %d\n" , __func__, status);return status;fs/nfs/pnfs.h +0
-2@@ -183,7 +183,6 @@ extern int nfs4_proc_getdeviceinfo(struct nfs_server *server,extern int nfs4_proc_layoutget (struct nfs4_layoutget *lgp);extern int nfs4_proc_layoutcommit (struct nfs4_layoutcommit_data *data,int issync); -extern int nfs4_proc_layoutreturn (struct nfs4_layoutreturn *lrp,bool wait);/* pnfs.c */ void get_layout_hdr (struct pnfs_layout_hdr *lo);@@ -193,7 +192,6 @@ bool should_free_lseg(struct pnfs_layout_range *lseg_range,struct pnfs_layout_segment *pnfs_update_layout (struct inode *ino,struct nfs_open_context *ctx,enum pnfs_iomode access_type); -bool pnfs_return_layout_barrier (struct nfs_inode *,struct pnfs_layout_range *);int _pnfs_return_layout (struct inode *,struct pnfs_layout_range *,bool wait);void set_pnfs_layoutdriver (struct nfs_server *,u32 id);void unset_pnfs_layoutdriver (struct nfs_server *);
Re: [PATCH 20/22] pnfs-submit: wave2: remove all LAYOUTRETURN code
On Thu, Dec 16, 2010 at 7:47 AM, Boaz Harrosh <[email protected]> wr= ote:
Quoted 5 lines · Fred Isaman
fs/nfs/pnfs.c void nfs4_asynch_forget_layouts(struct pnfs_lay=
Quoted 4 lines
fs/nfs/pnfs.c +0
-0@@ -599,55 +599,6 @@ void nfs4_asynch_forget_layouts(struct pnfs_lay=
out_hdr *lo,
Quoted 4 lines
fs/nfs/pnfs.c void nfs4_asynch_forget_layouts(struct pnfs_lay= · line 602
Quoted 4 lines
fs/nfs/pnfs.c +0
-1=A0 =A0 =A0 =A0 =A0 =A0 =A0 } =A0} -/* Return true if there is layout based io in progress in the given=
range.
Quoted 1 line
fs/nfs/pnfs.c void nfs4_asynch_forget_layouts(struct pnfs_lay= · line 603
Quoted 1 line
fs/nfs/pnfs.c +0
-1-* Assumes range has already been marked invalid, and layout marked=
to
Quoted 5 lines
fs/nfs/pnfs.c void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo,
Quoted 5 lines
fs/nfs/pnfs.c +0
-5-* prevent any new lseg from being inserted. -*/ -bool -pnfs_return_layout_barrier(struct nfs_inode *nfsi, - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct pnfs_layout_=
range *range)
Quoted 7 lines
fs/nfs/pnfs.c void nfs4_asynch_forget_layouts(struct pnfs_lay= · line 615
Quoted 7 lines
fs/nfs/pnfs.c +0
-7-{ - =A0 =A0 struct pnfs_layout_segment *lseg; - =A0 =A0 bool ret =3D false; - - =A0 =A0 spin_lock(&nfsi->vfs_inode.i_lock); - =A0 =A0 list_for_each_entry(lseg, &nfsi->layout->segs, fi_list) - =A0 =A0 =A0 =A0 =A0 =A0 if (should_free_lseg(&lseg->range, range))=
{
Quoted 10 lines
fs/nfs/pnfs.c void nfs4_asynch_forget_layouts(struct pnfs_lay= · line 625
Quoted 10 lines
fs/nfs/pnfs.c +0
-10- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D true; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; - =A0 =A0 =A0 =A0 =A0 =A0 } - =A0 =A0 spin_unlock(&nfsi->vfs_inode.i_lock); - =A0 =A0 dprintk("%s:Return %d\n", __func__, ret); - =A0 =A0 return ret; -} - -static int -return_layout(struct inode *ino, struct pnfs_layout_range *range, b=
ool wait)
Quoted 20 lines
Quoted 20 lines
fs/nfs/pnfs.c +0
-20-{ - =A0 =A0 struct nfs4_layoutreturn *lrp; - =A0 =A0 struct nfs_server *server =3D NFS_SERVER(ino); - =A0 =A0 int status =3D -ENOMEM; - - =A0 =A0 dprintk("--> %s\n", __func__); - - =A0 =A0 lrp =3D kzalloc(sizeof(*lrp), GFP_KERNEL); - =A0 =A0 if (lrp =3D=3D NULL) { - =A0 =A0 =A0 =A0 =A0 =A0 put_layout_hdr(ino); - =A0 =A0 =A0 =A0 =A0 =A0 goto out; - =A0 =A0 } - =A0 =A0 lrp->args.reclaim =3D 0; - =A0 =A0 lrp->args.layout_type =3D server->pnfs_curr_ld->id; - =A0 =A0 lrp->args.return_type =3D RETURN_FILE; - =A0 =A0 lrp->args.range =3D *range; - =A0 =A0 lrp->args.inode =3D ino; - =A0 =A0 lrp->clp =3D server->nfs_client; - - =A0 =A0 status =3D nfs4_proc_layoutreturn(lrp, wait);
Quoted 8 lines
Quoted 8 lines
fs/nfs/pnfs.c +0
-5-out: - =A0 =A0 dprintk("<-- %s status: %d\n", __func__, status); - =A0 =A0 return status; -} -=A0/* Initiates a LAYOUTRETURN(FILE) */
=A0int
=A0_pnfs_return_layout(struct inode *ino, structpnfs_layout_range*=
range,
Quoted 1 line
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct =
Quoted 1 line
fs/nfs/pnfs.c +0
-0@@ -673,21 +624,10 @@ _pnfs_return_layout(struct inode *ino, struct =
pnfs_layout_range *range,
Quoted 10 lines
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct = · line 682
Quoted 10 lines
fs/nfs/pnfs.c +0
-4=A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; =A0 =A0 =A0 } =A0 =A0 =A0 lo->plh_block_lgets++; - =A0 =A0 /* Reference matched in nfs4_layoutreturn_release */ - =A0 =A0 get_layout_hdr(lo); =A0 =A0 =A0 spin_unlock(&ino->i_lock); =A0 =A0 =A0 pnfs_free_lseg_list(&tmp_list); - =A0 =A0 if (layoutcommit_needed(nfsi)) { - =A0 =A0 =A0 =A0 =A0 =A0 status =3D pnfs_layoutcommit_inode(ino, wa=
it);
Quoted 2 lines
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct = · line 684
Quoted 2 lines
fs/nfs/pnfs.c +0
-2- =A0 =A0 =A0 =A0 =A0 =A0 if (status) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Return layout even if l=
ayoutcommit fails */
Quoted 1 line
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct = · line 685
Quoted 1 line
fs/nfs/pnfs.c +0
-1- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dprintk("%s: layoutcommit =
failed, status=3D%d. "
Quoted 1 line
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct = · line 686
Quoted 1 line
fs/nfs/pnfs.c +0
-1- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "Returning=
layout anyway\n",
Quoted 1 line
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct = · line 687
Quoted 1 line
fs/nfs/pnfs.c +0
-1- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __func__, =
status);
Quoted 5 lines
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct = · line 690
Quoted 3 lines
fs/nfs/pnfs.c +0
-3- =A0 =A0 =A0 =A0 =A0 =A0 } - =A0 =A0 } - =A0 =A0 status =3D return_layout(ino, &arg, wait);
Quoted 8 lines
You are also removing the layoutcommit.
1. You have not stated it anywhere, and snacked it in silently
2. If you are removing layoutcommit please do that in a different =A0 patch with it's own comment and explanation.
3. How come? forgetful or not layoutcommits are a different issue =A0 and must be done correctly when writing !!!?!Boaz
You are right, that should have been a separate patch.
=46red
Quoted 1 line
fs/nfs/pnfs.c _pnfs_return_layout(struct inode *ino, struct = · line 630
Quoted 1 line
fs/nfs/pnfs.c +1
-0+ =A0 =A0 /* Don't need to wait since this is followed by call to en=
d_writeback */
Quoted 8 lines
fs/nfs/pnfs.h extern int nfs4_proc_getdeviceinfo(struct nfs_se=
Quoted 8 lines
=A0out:
=A0 =A0 =A0dprintk("<-- %s status: %d\n", __func__, status); =A0 =A0 =A0 return status;fs/nfs/pnfs.h +0
-0@@ -183,7 +183,6 @@ extern int nfs4_proc_getdeviceinfo(struct nfs_se=
rver *server,
Quoted 2 lines
Quoted 2 lines
fs/nfs/pnfs.h +0
-0=A0extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp);=A0extern int nfs4_proc_layoutcommit(struct
nfs4_layoutcommit_data*=
data,
Quoted 1 line
Quoted 1 line
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0i=
nt issync);
Quoted 1 line
Quoted 1 line
-extern int nfs4_proc_layoutreturn(struct
nfs4_layoutreturn*lrp, bo=
ol wait);
Quoted 4 lines
fs/nfs/pnfs.h bool should_free_lseg(struct pnfs_layout_range *=
Quoted 4 lines
=A0/*
pnfs.c*/
=A0voidget_layout_hdr(struct pnfs_layout_hdr *lo);fs/nfs/pnfs.h +0
-0@@ -193,7 +192,6 @@ bool should_free_lseg(struct pnfs_layout_range *=
lseg_range,
Quoted 2 lines
Quoted 2 lines
=A0struct
pnfs_layout_segment* =A0pnfs_update_layout(struct inode *ino, structnfs_open_context*ct=
x,
Quoted 2 lines
Quoted 2 lines
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0enum
pnfs_iomodeaccess_type); -bool pnfs_return_layout_barrier(structnfs_inode*, struct pnfs_lay=
out_range *);
Quoted 1 line
Quoted 1 line
=A0int _pnfs_return_layout(struct inode *, struct
pnfs_layout_range=
*, bool wait);
Quoted 5 lines
Quoted 2 lines
=A0void
set_pnfs_layoutdriver(struct nfs_server *, u32 id); =A0voidunset_pnfs_layoutdriver(struct nfs_server *);--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" =
in
Quoted 3 lines
the body of a message to [email protected]
More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
PATCH 21/22 SQUASHME: pnfs: filelayout: call print_ds under ifdebug(FACILITY)
In reply to Fred Isaman--- fs/nfs/nfs4filelayout.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
fs/nfs/nfs4filelayout.c +2 -1
@@ -596,7 +596,8 @@ filelayout_commit(struct nfs_write_data *data, int sync) }dprintk ("%s: Initiating commit: %llu USE DS:\n" , __func__, file_offset); -print_ds (ds); +ifdebug (FACILITY) +print_ds (ds);/* Send COMMIT to data server */ nfs_initiate_commit (dsdata, clnt, call_ops, sync);
Signature · 1 line
1.7.2.1
PATCH 22/22 pnfs-submit: Turn off layoutcommits
In reply to Fred IsamanRecent changes to close can delay pending layoutcommit until umount, when the async layoutcommits can come tricklng in after we have destroyed the session. Since file does not need them, just turn them off for the moment. Non-file layouts will probably have to trigger them in some fashion at close.
A better solution is to just push all the layoutcommit code outside of the pnfs-submit branch. This is really just a stop gap until code is rearranged to make that easier.
--- fs/nfs/nfs4proc.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
fs/nfs/nfs4proc.c +0 -1
@@ -3098,7 +3098,6 @@ static void pnfs4_update_write_done(struct nfs_inode *nfsi, struct nfs_write_dat {#ifdef CONFIG_NFS_V4_1 pnfs_update_last_write (nfsi, data->args.offset, data->res.count); -pnfs_need_layoutcommit (nfsi, data->args.context);#endif /* CONFIG_NFS_V4_1 */ }
Signature · 1 line
1.7.2.1
Re: [PATCH 22/22] pnfs-submit: Turn off layoutcommits
Quoted 3 lines · Fred Isaman
Recent changes to close can delay pending layoutcommit until umount, when the async layoutcommits can come tricklng in after we have destroyed the session.
Then "Recent changes" are broken and should be fixed. It was fine before. New broken code is not acceptable.
Quoted 4 lines
Since file does not need them, just turn them off for the moment. Non-file layouts will probably have to trigger them in some fashion at close.
Rrrr. Are we back to this argument. We stand down win an argument and 2 weeks later you are back on it has if we never talked about it.
NO!!! only "coherent clustered filesystems" do not need them. It has nothing to do with layout type. A none-clustered aggregated parallel filesystem will need them just the same as blocks and objects.
AND THE STD DOES NOT GIVE YOU A CHOICE!!!
Quoted 4 lines
A better solution is to just push all the layoutcommit code outside of the pnfs-submit branch. This is really just a stop gap until code is rearranged to make that easier.
Than all this is not finished. Please keep it in the shops until the final solution is presented and we can actually see the new compared to the old system. Until then we should keep what worked and was tested.
Boaz
Quoted 17 lines
Signed-off-by Fred Isaman <[email protected]>--- fs/nfs/nfs4proc.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)fs/nfs/nfs4proc.c +0
-1@@ -3098,7 +3098,6 @@ static void pnfs4_update_write_done(struct nfs_inode *nfsi, struct nfs_write_dat {#ifdef CONFIG_NFS_V4_1 pnfs_update_last_write (nfsi, data->args.offset, data->res.count); -pnfs_need_layoutcommit (nfsi, data->args.context);#endif /* CONFIG_NFS_V4_1 */ }
Re: [PATCH 22/22] pnfs-submit: Turn off layoutcommits
Quoted 13 lines · Boaz Harrosh
Quoted 3 lines · Fred Isaman
Recent changes to close can delay pending layoutcommit until umount, when the async layoutcommits can come tricklng in after we have destroyed the session.
Then "Recent changes" are broken and should be fixed. It was fine before. New broken code is not acceptable.
Quoted 4 lines
Since file does not need them, just turn them off for the moment. Non-file layouts will probably have to trigger them in some fashion at close.
Quoted 8 lines
Rrrr. Are we back to this argument. We stand down win an argument and 2 weeks later you are back on it has if we never talked about it.
NO!!! only "coherent clustered filesystems" do not need them. It has nothing to do with layout type. A none-clustered aggregated parallel filesystem will need them just the same as blocks and objects.
AND THE STD DOES NOT GIVE YOU A CHOICE!!!
You keep saying this, but just repeating it does not convince me. Could you please take the time to explain *why* they are needed. A separate thread in the ietf list would be great. Because right now, Andy and I are coding and preparing for submission to Trond under the assumption that they are possibly a nice optimization, but are never actually needed for the file layout.
Fred
Quoted 35 lines
Quoted 5 lines
A better solution is to just push all the layoutcommit code outside of the pnfs-submit branch. This is really just a stop gap until code is rearranged to make that easier.
Than all this is not finished. Please keep it in the shops until the final solution is presented and we can actually see the new compared to the old system. Until then we should keep what worked and was tested.
Boaz
Quoted 10 lines
Signed-off-by Fred Isaman <[email protected]>---
fs/nfs/nfs4proc.c | 1 -1 files changed, 0 insertions(+), 1 deletions(-)fs/nfs/nfs4proc.c +0
-0fs/nfs/nfs4proc.c static void pnfs4_update_write_done(struct nfs_inode *nfsi, struct nfs_write_dat · line 3103
Quoted 7 lines
fs/nfs/nfs4proc.c +0
-1@@ -3098,7 +3098,6 @@ static void pnfs4_update_write_done(struct nfs_inode *nfsi, struct nfs_write_dat { #ifdef CONFIG_NFS_V4_1 pnfs_update_last_write(nfsi, data->args.offset, data->res.count); - pnfs_need_layoutcommit(nfsi, data->args.context); #endif /* CONFIG_NFS_V4_1 */ }--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 22/22] pnfs-submit: Turn off layoutcommits
Quoted 23 lines · Fred Isaman
Quoted 13 lines · Boaz Harrosh
Quoted 3 lines · Fred Isaman
Recent changes to close can delay pending layoutcommit until umount, when the async layoutcommits can come tricklng in after we have destroyed the session.
Then "Recent changes" are broken and should be fixed. It was fine before. New broken code is not acceptable.
Quoted 4 lines
Since file does not need them, just turn them off for the moment. Non-file layouts will probably have to trigger them in some fashion at close.
Quoted 8 lines
Rrrr. Are we back to this argument. We stand down win an argument and 2 weeks later you are back on it has if we never talked about it.
NO!!! only "coherent clustered filesystems" do not need them. It has nothing to do with layout type. A none-clustered aggregated parallel filesystem will need them just the same as blocks and objects.
AND THE STD DOES NOT GIVE YOU A CHOICE!!!
Quoted 9 lines
You keep saying this, but just repeating it does not convince me. Could you please take the time to explain *why* they are needed. A separate thread in the ietf list would be great. Because right now, Andy and I are coding and preparing for submission to Trond under the assumption that they are possibly a nice optimization, but are never actually needed for the file layout.
Fred
I have many times. You are being forgetful. Last bakeathon Mike, I think or someone, had a proposition talk that "since layoutcommit is use less, lets make it optional". And we went into a long argument about that. Until finally Trond came to the rescue and explained very clearly. Better then I ever could, that if you want to keep current reboot semantics a client must send a successful layoutcommit after all successful DS commits before it can free it's dirty pages. layoutcommit is the writing of meta data after the write of data, and is, just as important, a part of a file.
Consider an spNFS type filesystem that keeps all meta-data on MDS and the data on disjoint independent DSs. None of the servers see the same data and the MDS is just another client + Meta information. layoutcommit is the point data is exposed outside and also the point meta-data is persisted (Somewhere). Failing to do layoutcommits will not enable me to do such simple, scalable and possibly reliable FSs. The authors of the STD did envision such systems and invented the layoutcommit. (There is the issue of the changed_attribute of a crashing writing client but this is solvable with very simple MDS-to-DS communication, and is another matter)
The fact that we had the above talk also proves another thing. That the STD does not make layoutcommit optional, hence the request to make it optional.
And nothing of the above is new. I have stated that many times and you keep "forgetting".
BTW: An object based filesystem could be implemented just as well over files as over objects. Save the RAID5 stuff. Objects being partition/objectid numeric file names, and uid/gid games for fencing off / access permission. In such a system layoutcommits serve the same purpose as in objects, but with a files layout
You can call me and we can talk about it if you need to. But do You agree that the current STD text mandates it?
Boaz