Skip to contentSkip to conversation

PATCH/RFC: remove state from struct nfs4_state

PATCH NeilBrown 2 participants 3 messages Aug 24, 2011

Subsystems (15)
USB NFS client NFS server HID +11 more subsystems
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

Hi,
I've been looking at the error handling code in nfs4 and noticed that 'state' in 'struct nfs4_exception' is never set (except to NULL). Looking back through history, it looks like it never has been.

So either it should be set and the code is wrong somewhere, or it can be safely removed. Unfortunately I cannot say which..

So: In case you think it is correct to remove it - the patch is below.

Thanks,
NeilBrown

NFS: remove 'state' from 'struct nfs4_state'.

This field is never set and it appears that it never has been. So just remove it.

fs/nfs/nfs4_fs.h +0 -1
index 1ec1a85..36639a0 100644
@@ -211,7 +211,6 @@ struct nfs4_state {
 struct nfs4_exception {
 	long timeout;
 	int retry;
-	struct nfs4_state *state;
 };
 
 struct nfs4_state_recovery_ops {
fs/nfs/nfs4proc.c +1 -7
index 8c77039..8c99ee4 100644
@@ -257,7 +257,6 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
 static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_exception *exception)
 {
 	struct nfs_client *clp = server->nfs_client;
-	struct nfs4_state *state = exception->state;
 	int ret = errorcode;
 
 	exception->retry = 0;
@@ -267,13 +266,8 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
 		case -NFS4ERR_ADMIN_REVOKED:
 		case -NFS4ERR_BAD_STATEID:
 		case -NFS4ERR_OPENMODE:
-			if (state == NULL)
-				break;
-			nfs4_schedule_stateid_recovery(server, state);
-			goto wait_on_recovery;
+			break;
 		case -NFS4ERR_EXPIRED:
-			if (state != NULL)
-				nfs4_schedule_stateid_recovery(server, state);
 		case -NFS4ERR_STALE_STATEID:
 		case -NFS4ERR_STALE_CLIENTID:
 			nfs4_schedule_lease_recovery(clp);
include/linux/configfs.h +2 -2
index 3081c58..9723858 100644
@@ -15,8 +15,8 @@
  *
  * You should have received a copy of the GNU General Public
  * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *
  * Based on sysfs:
  * 	sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
include/linux/dca.h +2 -2
index d27a7a0..02d4764 100644
@@ -12,8 +12,8 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * The full GNU General Public License is included in this distribution in the
  * file called COPYING.
include/linux/dcbnl.h +2 -2
index 65a2562..a7a9b43 100644
@@ -11,8 +11,8 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * Author: Lucy Liu <[email protected]>
  */
include/linux/display.h +1 -1
index 3bf70d6..3412709 100644
@@ -15,7 +15,7 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
include/linux/dmaengine.h +2 -2
index 8fbf40e..b0bddd4 100644
@@ -12,8 +12,8 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * The full GNU General Public License is included in this distribution in the
  * file called COPYING.
include/linux/dmar.h +2 -2
index 7b776d7..d989fb6 100644
@@ -11,8 +11,8 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * Copyright (C) Ashok Raj <[email protected]>
  * Copyright (C) Shaohua Li <[email protected]>
include/linux/eeprom_93cx6.h +1 -1
index c4627cb..e59965d 100644
@@ -15,7 +15,7 @@
 	You should have received a copy of the GNU General Public License
 	along with this program; if not, write to the
 	Free Software Foundation, Inc.,
-	59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+	51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 /*
include/linux/hidraw.h +1 -1
index 4b88e69..ccfea00 100644
@@ -12,7 +12,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #include <linux/hid.h>
include/linux/i2c/tps65010.h +1 -1
index 08aa922..07a9ad2 100644
@@ -22,7 +22,7 @@
  *
  * You should have received a copy of the  GNU General Public License along
  * with this program; if not, write  to the Free Software Foundation, Inc.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #ifndef __LINUX_I2C_TPS65010_H
include/linux/intel-iommu.h +2 -2
index 9310c69..697066f 100644
@@ -11,8 +11,8 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * Copyright (C) 2006-2008 Intel Corporation
  * Author: Ashok Raj <[email protected]>
include/linux/intel_mid_dma.h +1 -1
index 10496bd..40fdd99 100644
@@ -16,7 +16,7 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
include/linux/ipmi.h +1 -1
index ca85cf8..4f1717c 100644
@@ -28,7 +28,7 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #ifndef __LINUX_IPMI_H
include/linux/ipmi_msgdefs.h +1 -1
index df97e6e..d4b0bba 100644
@@ -28,7 +28,7 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #ifndef __LINUX_IPMI_MSGDEFS_H
include/linux/ipmi_smi.h +1 -1
index 204f9cd..85e2609 100644
@@ -28,7 +28,7 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #ifndef __LINUX_IPMI_SMI_H
include/linux/mfd/pcf50633/backlight.h +1 -1
index 83747e2..2e0fc62 100644
@@ -9,7 +9,7 @@
  *
  *  You should have received a copy of the  GNU General Public License along
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  */
 
include/linux/nfc.h +1 -1
index 330a4c5..6ad6da3 100644
@@ -18,7 +18,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the
  * Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #ifndef __LINUX_NFC_H
include/linux/nl802154.h +1 -1
index 33d9f51..b8a720b 100644
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  */
 
include/linux/omapfb.h +1 -1
index c0b0187..94f48a8 100644
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #ifndef __LINUX_OMAPFB_H__
include/linux/padata.h +1 -1
index 4633b2f..501c2bf 100644
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #ifndef PADATA_H
include/linux/power/bq20z75.h +1 -1
index 1398eb0..7dc9e51 100644
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 #ifndef __LINUX_POWER_BQ20Z75_H_
include/linux/power/gpio-charger.h +1 -1
index de1dfe0..ad54842 100644
@@ -8,7 +8,7 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  */
 
include/linux/power/jz4740-battery.h +1 -1
index 19c9610..b13eb5f 100644
@@ -8,7 +8,7 @@
  *
  *  You should have received a copy of the  GNU General Public License along
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  */
 
include/linux/raid/pq.h +4 -3
index 2b59cc8..207c1c9 100644
@@ -4,9 +4,10 @@
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
- *   Boston MA 02111-1307, USA; either version 2 of the License, or
- *   (at your option) any later version; incorporated herein by reference.
+ *   the Free Software Foundation, Inc.,
+ *   51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA; either
+ *   version 2 of the License, or (at your option) any later version;
+ *   incorporated herein by reference.
  *
  * ----------------------------------------------------------------------- */
 
include/linux/rfkill-gpio.h +1 -1
index a175d05..77ce686 100644
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 
 
include/linux/stmmac.h +1 -1
index 0dddc9e..4746368 100644
@@ -15,7 +15,7 @@
 
   You should have received a copy of the GNU General Public License along with
   this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
 
   The full GNU General Public License is included in this distribution in
   the file called "COPYING".
include/linux/tboot.h +1 -1
index 1dba6ee..9b92db8 100644
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  */
 
include/linux/tc_act/tc_skbedit.h +2 -2
index 7a2e910..5c25e33 100644
@@ -11,8 +11,8 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * Author: Alexander Duyck <[email protected]>
  */
include/linux/thermal.h +1 -1
index 47b4a27..7e13288 100644
@@ -17,7 +17,7 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
include/linux/timecompare.h +1 -1
index 546e223..e2fd5e1 100644
@@ -42,7 +42,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  */
 #ifndef _LINUX_TIMECOMPARE_H
 #define _LINUX_TIMECOMPARE_H
include/linux/usb/intel_mid_otg.h +1 -1
index a0ccf79..87d324c 100644
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  */
 
include/linux/usb/langwell_otg.h +1 -1
index 51f17b1..5d90ea1 100644
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  */
 
include/linux/usb/langwell_udc.h +1 -1
index 2d2d1bb..343e91f 100644
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  */
 
include/linux/video_output.h +1 -1
index ed5cdeb..bf8afb9 100644
@@ -16,7 +16,7 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *  51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
#1 lore raw
Quoted 1 line · NeilBrown

<snip>

include/linux/configfs.h line 19

Quoted 12 lines
include/linux/configfs.h +2 -2
index 3081c58..9723858 100644
@@ -15,8 +15,8 @@
  *
  * You should have received a copy of the GNU General Public
  * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

You did not mean to add all these changes in this particular patch, did you?

If you are at fixing this (snail mail) address. Can't you just remove the darn thing, that no one ever care about. I thing you don't need any address. But the most it should just be an email. Please don't let us slave every time FSF changes the rent (As your patch said about something else this address is set but
is never used. Proof of - It was wrong for so many years and no one was hurt ;-) )

Boaz

author
#2 lore raw
Quoted 18 lines · On Wed, 24 Aug 2011 16:17:47 -0700 Boaz Harrosh <[email protected]> wrote:
Quoted 1 line · NeilBrown

<snip>

include/linux/configfs.h line 19

Quoted 12 lines
include/linux/configfs.h +2 -2
index 3081c58..9723858 100644
@@ -15,8 +15,8 @@
  *
  * You should have received a copy of the GNU General Public
  * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

You did not mean to add all these changes in this particular patch, did you?

Oops.... I thought it was a clean tree that I was working with. Sorry.

Quoted 8 lines

If you are at fixing this (snail mail) address. Can't you just remove the darn thing, that no one ever care about. I thing you don't need any address. But the most it should just be an email. Please don't let us slave every time FSF changes the rent (As your patch said about something else this address is set but
is never used. Proof of - It was wrong for so many years and no one was hurt ;-) )

:-)

It is certainly wrong having a wrong address. We should either fix it or remove it. The GPL under which the source is released seems to suggest that it should be fixed. But that isn't really a topic for this email.

This is the only part of the patch that I meant to send.

Thanks,
NeilBrown

fs/nfs/nfs4_fs.h +0 -1
index 1ec1a85..36639a0 100644
@@ -211,7 +211,6 @@ struct nfs4_state {
 struct nfs4_exception {
 	long timeout;
 	int retry;
-	struct nfs4_state *state;
 };
 
 struct nfs4_state_recovery_ops {
fs/nfs/nfs4proc.c +1 -7
index 8c77039..8c99ee4 100644
@@ -257,7 +257,6 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
 static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_exception *exception)
 {
 	struct nfs_client *clp = server->nfs_client;
-	struct nfs4_state *state = exception->state;
 	int ret = errorcode;
 
 	exception->retry = 0;
@@ -267,13 +266,8 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
 		case -NFS4ERR_ADMIN_REVOKED:
 		case -NFS4ERR_BAD_STATEID:
 		case -NFS4ERR_OPENMODE:
-			if (state == NULL)
-				break;
-			nfs4_schedule_stateid_recovery(server, state);
-			goto wait_on_recovery;
+			break;
 		case -NFS4ERR_EXPIRED:
-			if (state != NULL)
-				nfs4_schedule_stateid_recovery(server, state);
 		case -NFS4ERR_STALE_STATEID:
 		case -NFS4ERR_STALE_CLIENTID:
 			nfs4_schedule_lease_recovery(clp);