What's in the 'bugfixes' branch of the NFS client git tree
Subsystems (2)
cover What's in the 'bugfixes' branch of the NFS client git tree
I've committed the following patches to the 'bugfixes' branch for merging into mainline before the release of 2.6.33. Please review
Cheers
Trond
---
David Howells (1):
NFS: Avoid warnings when CONFIG_NFS_V4=n
H Hartley Sweeten (1):
NFS: Make nfs_commitdata_release static
Trond Myklebust (6):
NFS: Ensure that we handle NFS4ERR_STALE_STATEID correctly NFSv4.1: Don't call nfs4_schedule_state_recovery() unnecessarily
NFSv4: Don't allow posix locking against servers that don't support it
NFSv4: Ensure that the NFSv4 locking can recover from stateid errors
NFS: Try to commit unstable writes in nfs_release_page()
NFS: Fix a reference leak in nfs_wb_cancel_page()
fs/nfs/file.c | 2 + fs/nfs/nfs4_fs.h | 2 + fs/nfs/nfs4proc.c | 78 +++++++++++++++++++++++++++++++++++++++------------- fs/nfs/nfs4state.c | 2 + fs/nfs/sysctl.c | 2 + fs/nfs/write.c | 3 +- 6 files changed, 67 insertions(+), 22 deletions(-)
A message that is not in the archive (sent off-list or not yet received): 20100125215734.14716.19614.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]
PATCH 1/8 NFS: Fix a reference leak in nfs_wb_cancel_page()
---
fs/nfs/write.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/nfs/write.c +1 -0
@@ -1541,6 +1541,7 @@ int nfs_wb_page_cancel(struct inode *inode, struct page *page)break ; } ret =nfs_wait_on_request (req); +nfs_release_request (req);if (ret <0 ) goto out; }
PATCH 2/8 NFS: Try to commit unstable writes in nfs_release_page()
In reply to a message not in the archiveIf someone calls nfs_release_page(), we presumably already know that the page is clean, however it may be holding an unstable write.
---
fs/nfs/file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
fs/nfs/file.c +2 -0
@@ -486,6 +486,8 @@ static int nfs_release_page(struct page *page, gfp_t gfp) {dfprintk (PAGECACHE ,"NFS: release_page(%p)\n" , page); +if (gfp & __GFP_WAIT) +nfs_wb_page (page->mapping->host, page);/* If PagePrivate() is set, then the page is not freeable */ if (PagePrivate (page))return 0 ;
PATCH 3/8 NFS: Make nfs_commitdata_release static
In reply to a message not in the archiveFrom: H Hartley Sweeten <[email protected]>
The symbol nfs_commitdata_release is only used locally
in this file. Make it static to prevent the following sparse warning:
warning: symbol 'nfs_commitdata_release' was not declared. Should it be static?
---
fs/nfs/write.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/write.c +1 -1
@@ -1233,7 +1233,7 @@ int nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)#if defined(CONFIG_NFS_V3 ) || defined(CONFIG_NFS_V4 ) -void nfs_commitdata_release (void *data) +static void nfs_commitdata_release (void *data) {struct nfs_write_data *wdata = data;
PATCH 4/8 NFS: Avoid warnings when CONFIG_NFS_V4=n
In reply to a message not in the archiveFrom: David Howells <[email protected]>
Avoid the following warnings when CONFIG_NFS_V4=n:
fs/nfs/sysctl.c:19: warning: unused variable nfs_set_port_max' fs/nfs/sysctl.c:18: warning: unused variable nfs_set_port_min'
by making those variables contingent on NFSv4 being configured.
---
fs/nfs/sysctl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
fs/nfs/sysctl.c +2 -0
@@ -15,8 +15,10 @@#include "callback.h" +#ifdef CONFIG_NFS_V4 static const int nfs_set_port_min =0 ;static const int nfs_set_port_max =65535 ; +#endif static struct ctl_table_header *nfs_callback_sysctl_table;static ctl_table nfs_cb_sysctls[] = {
PATCH 5/8 NFSv4: Ensure that the NFSv4 locking can recover from stateid errors
In reply to a message not in the archiveIn most cases, we just want to mark the lock_stateid sequence id as being uninitialised.
---
fs/nfs/nfs4proc.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-)
fs/nfs/nfs4proc.c +19 -0
@@ -4088,6 +4088,22 @@ static const struct rpc_call_ops nfs4_recover_lock_ops = { .rpc_release = nfs4_lock_release, }; +static void nfs4_handle_setlk_error (struct nfs_server *server,struct nfs4_lock_state *lsp,int new_lock_owner,int error) +{ +struct nfs_client *clp = server->nfs_client; +struct nfs4_state *state = lsp->ls_state; + +switch (error) { +case -NFS4ERR_ADMIN_REVOKED : +case -NFS4ERR_BAD_STATEID : +case -NFS4ERR_EXPIRED : +if (new_lock_owner !=0 || + (lsp->ls_flags &NFS_LOCK_INITIALIZED ) !=0 ) +nfs4_state_mark_reclaim_nograce (clp, state); + lsp->ls_seqid.flags &= ~NFS_SEQID_CONFIRMED ; + }; +} +static int _nfs4_do_setlk (struct nfs4_state *state,int cmd,struct file_lock *fl,int recovery_type) {struct nfs4_lockdata *data;
@@ -4126,6 +4142,9 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f ret =nfs4_wait_for_completion_rpc_task (task);if (ret ==0 ) { ret = data->rpc_status; +if (ret) +nfs4_handle_setlk_error (data->server, data->lsp, + data->arg.new_lock_owner, ret); }else data->cancelled =1 ;rpc_put_task (task);
PATCH 6/8 NFSv4: Don't allow posix locking against servers that don't support it
In reply to a message not in the archive---
fs/nfs/nfs4_fs.h | 1 + fs/nfs/nfs4proc.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletions(-)
fs/nfs/nfs4_fs.h +1 -0
@@ -146,6 +146,7 @@ enum {NFS_O_RDWR_STATE ,/* OPEN stateid has read/write state */ NFS_STATE_RECLAIM_REBOOT ,/* OPEN stateid server rebooted */ NFS_STATE_RECLAIM_NOGRACE ,/* OPEN stateid needs to recover state */ + NFS_STATE_POSIX_LOCKS, /* Posix locks are supported */ }; struct nfs4_state {
fs/nfs/nfs4proc.c +6 -1
@@ -1658,6 +1658,8 @@ static int _nfs4_do_open(struct inode *dir, struct path *path, fmode_t fmode, in status =PTR_ERR (state);if (IS_ERR (state)) goto err_opendata_put; +if ((opendata->o_res.rflags &NFS4_OPEN_RESULT_LOCKTYPE_POSIX ) !=0 ) +set_bit (NFS_STATE_POSIX_LOCKS , &state->flags);nfs4_opendata_put (opendata);nfs4_put_state_owner (sp); *res = state;
@@ -4200,8 +4202,11 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock {struct nfs_inode *nfsi =NFS_I (state->inode);unsigned char fl_flags = request->fl_flags; -int status; +int status = -ENOLCK ; +if ((fl_flags &FL_POSIX ) && + !test_bit (NFS_STATE_POSIX_LOCKS , &state->flags)) + goto out;/* Is this a delegated open? */ status =nfs4_set_lock_state (state, request);if (status !=0 )
PATCH 7/8 NFSv4.1: Don't call nfs4_schedule_state_recovery() unnecessarily
In reply to a message not in the archiveCurrently, nfs4_handle_exception() will call it twice if called with an error of -NFS4ERR_STALE_CLIENTID, -NFS4ERR_STALE_STATEID or -NFS4ERR_EXPIRED.
---
fs/nfs/nfs4proc.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)
fs/nfs/nfs4proc.c +2 -6
@@ -256,12 +256,8 @@ static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, ret =nfs4_wait_clnt_recover (clp);if (ret ==0 ) exception->retry =1 ; -#if !defined(CONFIG_NFS_V4_1 )break ; -#else /* !defined(CONFIG_NFS_V4_1) */ -if (!nfs4_has_session (server->nfs_client)) -break ; -/* FALLTHROUGH */ +#if defined(CONFIG_NFS_V4_1 )case -NFS4ERR_BADSESSION :case -NFS4ERR_BADSLOT :case -NFS4ERR_BAD_HIGH_SLOT :
@@ -274,7 +270,7 @@ static int nfs4_handle_exception(const struct nfs_server *server, int errorcode,nfs4_schedule_state_recovery (clp); exception->retry =1 ;break ; -#endif /* !defined(CONFIG_NFS_V4_1) */ +#endif /* defined(CONFIG_NFS_V4_1) */ case -NFS4ERR_FILE_OPEN :if (exception->timeout >HZ ) {/* We have retried a decent amount, time to
PATCH 8/8 NFS: Ensure that we handle NFS4ERR_STALE_STATEID correctly
In reply to a message not in the archiveEven if the server is crazy, we should be able to mark the stateid as being bad, to ensure it gets recovered.
---
fs/nfs/nfs4_fs.h | 1 + fs/nfs/nfs4proc.c | 44 +++++++++++++++++++++++++++++++------------- fs/nfs/nfs4state.c | 2 +- 3 files changed, 33 insertions(+), 14 deletions(-)
fs/nfs/nfs4_fs.h +1 -0
@@ -278,6 +278,7 @@ extern void nfs4_state_set_mode_locked(struct nfs4_state *, fmode_t);extern void nfs4_schedule_state_recovery (struct nfs_client *);extern void nfs4_schedule_state_manager (struct nfs_client *);extern int nfs4_state_mark_reclaim_nograce (struct nfs_client *clp,struct nfs4_state *state); +extern int nfs4_state_mark_reclaim_reboot (struct nfs_client *clp,struct nfs4_state *state);extern void nfs41_handle_sequence_flag_errors (struct nfs_client *clp,u32 flags);extern void nfs4_put_lock_state (struct nfs4_lock_state *lsp);extern int nfs4_set_lock_state (struct nfs4_state *state,struct file_lock *fl);
fs/nfs/nfs4proc.c +31 -13
78 lines not on this page · raw message
fs/nfs/nfs4state.c +1 -1
@@ -901,7 +901,7 @@ void nfs4_schedule_state_recovery(struct nfs_client *clp)nfs4_schedule_state_manager (clp); } -static int nfs4_state_mark_reclaim_reboot (struct nfs_client *clp,struct nfs4_state *state) +int nfs4_state_mark_reclaim_reboot (struct nfs_client *clp,struct nfs4_state *state) {set_bit (NFS_STATE_RECLAIM_REBOOT , &state->flags);
Quoted 2 lines · Trond Myklebust
I've committed the following patches to the 'bugfixes' branch for merging into mainline before the release of 2.6.33. Please review
I checked for mechanical problems. The semantics of NFSv4 locking is beyond me, but fortunately the changes looked mostly obvious.
Quoted 31 lines
Cheers
Trond---
David Howells (1):
NFS: Avoid warnings whenCONFIG_NFS_V4=nH Hartley Sweeten (1):
NFS: Makenfs_commitdata_releasestaticTrond Myklebust (6):
NFS: Ensure that we handleNFS4ERR_STALE_STATEIDcorrectly NFSv4.1: Don't callnfs4_schedule_state_recovery()unnecessarily
NFSv4: Don't allow posix locking against servers that don't
support it
NFSv4: Ensure that the NFSv4 locking can recover from stateid
errors
NFS: Try to commit unstable writes innfs_release_page()
NFS: Fix a reference leak innfs_wb_cancel_page()fs/nfs/file.c | 2 + fs/nfs/nfs4_fs.h | 2 + fs/nfs/nfs4proc.c | 78 ++++++++++++++++++++++++++++++++++++++ +------------- fs/nfs/nfs4state.c | 2 + fs/nfs/sysctl.c | 2 + fs/nfs/write.c | 3 +- 6 files changed, 67 insertions(+), 22 deletions(-)
Quoted 4 lines
--
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
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com