Merge tag 'riscv-for-linus-5.11-mw0' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / fs / afs / inode.c
index 0fe8844..b0d7b89 100644 (file)
@@ -294,6 +294,13 @@ void afs_vnode_commit_status(struct afs_operation *op, struct afs_vnode_param *v
                        op->flags &= ~AFS_OPERATION_DIR_CONFLICT;
                }
        } else if (vp->scb.have_status) {
+               if (vp->dv_before + vp->dv_delta != vp->scb.status.data_version &&
+                   vp->speculative)
+                       /* Ignore the result of a speculative bulk status fetch
+                        * if it splits around a modification op, thereby
+                        * appearing to regress the data version.
+                        */
+                       goto out;
                afs_apply_status(op, vp);
                if (vp->scb.have_cb)
                        afs_apply_callback(op, vp);
@@ -305,6 +312,7 @@ void afs_vnode_commit_status(struct afs_operation *op, struct afs_vnode_param *v
                }
        }
 
+out:
        write_sequnlock(&vnode->cb_lock);
 
        if (vp->scb.have_status)