Skip to contentSkip to conversation

nfs: pnfs: use GFP_ATOMIC under spin lock

PATCH Trond Myklebust 1 participant 1 message Jun 29, 2020 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 20 lines · Xu Wang

A spin lock is taken here so we should use GFP_ATOMIC.

---
 fs/nfs/pnfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/pnfs.c +1 -1
index dd2e14f5875d..d84c1b7b71d2 100644
@@ -2170,7 +2170,7 @@ _pnfs_grab_empty_layout(struct inode *ino,
 struct nfs_open_context *ctx)
 	struct pnfs_layout_hdr *lo;
 
 	spin_lock(&ino->i_lock);
-	lo = pnfs_find_alloc_layout(ino, ctx, GFP_KERNEL);
+	lo = pnfs_find_alloc_layout(ino, ctx, GFP_ATOMIC);
 	if (!lo)
 		goto out_unlock;
Quoted 1 line

if (!test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags))

NACK. Please read the code before sending yet another one of these pointless patches.

Signature · 3 lines
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]