Commit 7a56db02 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfs-for-5.7-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfix from Trond Myklebust:
 "Fix an ABBA spinlock issue in pnfs_update_layout()"

* tag 'nfs-for-5.7-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  NFS: Fix an ABBA spinlock issue in pnfs_update_layout()
parents 2fcd8014 fbf4bcc9
...@@ -2023,6 +2023,7 @@ pnfs_update_layout(struct inode *ino, ...@@ -2023,6 +2023,7 @@ pnfs_update_layout(struct inode *ino,
goto lookup_again; goto lookup_again;
} }
spin_unlock(&ino->i_lock);
first = true; first = true;
status = nfs4_select_rw_stateid(ctx->state, status = nfs4_select_rw_stateid(ctx->state,
iomode == IOMODE_RW ? FMODE_WRITE : FMODE_READ, iomode == IOMODE_RW ? FMODE_WRITE : FMODE_READ,
...@@ -2032,12 +2033,12 @@ pnfs_update_layout(struct inode *ino, ...@@ -2032,12 +2033,12 @@ pnfs_update_layout(struct inode *ino,
trace_pnfs_update_layout(ino, pos, count, trace_pnfs_update_layout(ino, pos, count,
iomode, lo, lseg, iomode, lo, lseg,
PNFS_UPDATE_LAYOUT_INVALID_OPEN); PNFS_UPDATE_LAYOUT_INVALID_OPEN);
spin_unlock(&ino->i_lock);
nfs4_schedule_stateid_recovery(server, ctx->state); nfs4_schedule_stateid_recovery(server, ctx->state);
pnfs_clear_first_layoutget(lo); pnfs_clear_first_layoutget(lo);
pnfs_put_layout_hdr(lo); pnfs_put_layout_hdr(lo);
goto lookup_again; goto lookup_again;
} }
spin_lock(&ino->i_lock);
} else { } else {
nfs4_stateid_copy(&stateid, &lo->plh_stateid); nfs4_stateid_copy(&stateid, &lo->plh_stateid);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment