@@ -100,10 +100,6 @@ int nfs4_op_savefh(struct nfs_argop4 *op,
compound_data_t *data,
 
        data->savedFH.nfs_fh4_len = data->currentFH.nfs_fh4_len;
 
-       /* Save the current stateid */
-       data->saved_stateid = data->current_stateid;
-       data->saved_stateid_valid = data->current_stateid_valid;
-
        /* If old SavedFH had a related export, release reference. */
        if (data->saved_export != NULL)
                put_gsh_export(data->saved_export);
@@ -116,18 +112,11 @@ int nfs4_op_savefh(struct nfs_argop4 *op,
compound_data_t *data,
        if (data->saved_obj == data->current_obj)
                goto out;
 
-       if (data->saved_obj) {
-               data->saved_obj->obj_ops.release(data->saved_obj);
-               data->saved_obj = NULL;
-       }
-
-       if (data->saved_ds) {
-               ds_handle_put(data->saved_ds);
-               data->saved_ds = NULL;
-       }
+       set_saved_entry(data, data->current_obj);
 
-       data->saved_obj = data->current_obj;
-       data->saved_filetype = data->current_filetype;
+       /* Save the current stateid */
+       data->saved_stateid = data->current_stateid;
+       data->saved_stateid_valid = data->current_stateid_valid;
 
        /* Make SAVEFH work right for DS handle */
        if (data->current_ds != NULL) {

Hmm, I wonder if any 4.1 client would ever make use of a side effect that
has been changed...

If you have already done a SAVEFH, and then do some stateid mutating
operations, a subsequent SAVEFH without any intervening operation that
disrupts the current FH would have updated the saved stateid. Now that will
not be the case.

I note that RESTOREFH doesn't do any check to see if CurrentFH == SavedFH,
maybe we really don't need that check?

In Protocols/NLM/nlm_util.c:

@@ -216,6 +216,7 @@ static void nlm4_send_grant_msg(state_async_queue_t
*arg)
 
        /*PTHREAD_RWLOCK_wrlock(&cookie_entry->sce_entry->state_lock);*/
 
+       /* XXX dang this does nothing that could require a write lock */
        if (cookie_entry->sce_lock_entry->sle_block_data == NULL) {
                /* Wow, we're not doing well... */
 
/*PTHREAD_RWLOCK_unlock(&cookie_entry->sce_entry->state_lock);*/

You should cleanup the napalm patch to just remove those locks, or do so in
a separate cleanup patch...

The need for that lock went away a long time ago...

Hmm, I think that finally does it...

Will have to re-review after all the updates...


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


------------------------------------------------------------------------------
_______________________________________________
Nfs-ganesha-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to