Skip to contentSkip to conversation

NFSv4.1 handle DS stateid errors

DISCUSSION Dan Carpenter 1 participant 1 message Mar 8, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Andy Adamson,

This is a semi-automatic email about new static checker warnings.

The patch 9cb8196839ab: "NFSv4.1 handle DS stateid errors" from Mar 7, 2012, leads to the following Smatch complaint:

fs/nfs/nfs4filelayout.c:102 filelayout_async_handle_error()
warn: variable dereferenced before check 'state' (see line 90)

fs/nfs/nfs4filelayout.c

    89	{
    90		struct nfs_server *mds_server = NFS_SERVER(state->inode);
                                                           ^^^^^^^^^^^^

new dereference.

    91		struct nfs_client *mds_client = mds_server->nfs_client;
    92	
    93		if (task->tk_status >= 0)
    94			return 0;
    95		*reset = 0;
    96	
    97		switch (task->tk_status) {
    98		/* MDS state errors */
    99		case -NFS4ERR_DELEG_REVOKED:
   100		case -NFS4ERR_ADMIN_REVOKED:
   101		case -NFS4ERR_BAD_STATEID:
   102			if (state != NULL)
                            ^^^^^^^^^^^^^

new check.

   103				nfs_remove_bad_delegation(state->inode);
   104		case -NFS4ERR_OPENMODE:

regards,
dan carpenter