@@ -1102,7 +1102,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
1102
1102
nf = nfsd_file_alloc (& key , may_flags );
1103
1103
if (!nf ) {
1104
1104
status = nfserr_jukebox ;
1105
- goto out_status ;
1105
+ goto out ;
1106
1106
}
1107
1107
1108
1108
ret = rhashtable_lookup_insert_key (& nfsd_file_rhash_tbl ,
@@ -1111,13 +1111,11 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
1111
1111
if (likely (ret == 0 ))
1112
1112
goto open_file ;
1113
1113
1114
- nfsd_file_slab_free (& nf -> nf_rcu );
1115
- nf = NULL ;
1116
1114
if (ret == - EEXIST )
1117
1115
goto retry ;
1118
1116
trace_nfsd_file_insert_err (rqstp , key .inode , may_flags , ret );
1119
1117
status = nfserr_jukebox ;
1120
- goto out_status ;
1118
+ goto construction_err ;
1121
1119
1122
1120
wait_for_construction :
1123
1121
wait_on_bit (& nf -> nf_flags , NFSD_FILE_PENDING , TASK_UNINTERRUPTIBLE );
@@ -1127,29 +1125,25 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
1127
1125
trace_nfsd_file_cons_err (rqstp , key .inode , may_flags , nf );
1128
1126
if (!open_retry ) {
1129
1127
status = nfserr_jukebox ;
1130
- goto out ;
1128
+ goto construction_err ;
1131
1129
}
1132
1130
open_retry = false;
1133
- if (refcount_dec_and_test (& nf -> nf_ref ))
1134
- nfsd_file_free (nf );
1135
1131
goto retry ;
1136
1132
}
1137
-
1138
1133
this_cpu_inc (nfsd_file_cache_hits );
1139
1134
1140
1135
status = nfserrno (nfsd_open_break_lease (file_inode (nf -> nf_file ), may_flags ));
1136
+ if (status != nfs_ok ) {
1137
+ nfsd_file_put (nf );
1138
+ nf = NULL ;
1139
+ }
1140
+
1141
1141
out :
1142
1142
if (status == nfs_ok ) {
1143
1143
this_cpu_inc (nfsd_file_acquisitions );
1144
1144
nfsd_file_check_write_error (nf );
1145
1145
* pnf = nf ;
1146
- } else {
1147
- if (refcount_dec_and_test (& nf -> nf_ref ))
1148
- nfsd_file_free (nf );
1149
- nf = NULL ;
1150
1146
}
1151
-
1152
- out_status :
1153
1147
put_cred (key .cred );
1154
1148
trace_nfsd_file_acquire (rqstp , key .inode , may_flags , nf , status );
1155
1149
return status ;
@@ -1179,6 +1173,13 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
1179
1173
if (status != nfs_ok )
1180
1174
nfsd_file_unhash (nf );
1181
1175
clear_and_wake_up_bit (NFSD_FILE_PENDING , & nf -> nf_flags );
1176
+ if (status == nfs_ok )
1177
+ goto out ;
1178
+
1179
+ construction_err :
1180
+ if (refcount_dec_and_test (& nf -> nf_ref ))
1181
+ nfsd_file_free (nf );
1182
+ nf = NULL ;
1182
1183
goto out ;
1183
1184
}
1184
1185
0 commit comments