Skip to content

Commit 3764a17

Browse files
Trond Myklebustamschuma-ntap
authored andcommitted
NFSv4/pNFS: Do not fail I/O when we fail to allocate the pNFS layout
Commit 587f03d caused pnfs_update_layout() to stop returning ENOMEM when the memory allocation fails, and hence causes it to fall back to trying to do I/O through the MDS. There is no guarantee that this will fare any better. If we're failing the pNFS layout allocation, then we should just redirty the page and retry later. Reported-by: Olga Kornievskaia <[email protected]> Fixes: 587f03d ("pnfs: refactor send_layoutget") Signed-off-by: Trond Myklebust <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 4522844 commit 3764a17

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/nfs/pnfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,7 @@ pnfs_update_layout(struct inode *ino,
20002000
lo = pnfs_find_alloc_layout(ino, ctx, gfp_flags);
20012001
if (lo == NULL) {
20022002
spin_unlock(&ino->i_lock);
2003+
lseg = ERR_PTR(-ENOMEM);
20032004
trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg,
20042005
PNFS_UPDATE_LAYOUT_NOMEM);
20052006
goto out;
@@ -2128,6 +2129,7 @@ pnfs_update_layout(struct inode *ino,
21282129

21292130
lgp = pnfs_alloc_init_layoutget_args(ino, ctx, &stateid, &arg, gfp_flags);
21302131
if (!lgp) {
2132+
lseg = ERR_PTR(-ENOMEM);
21312133
trace_pnfs_update_layout(ino, pos, count, iomode, lo, NULL,
21322134
PNFS_UPDATE_LAYOUT_NOMEM);
21332135
nfs_layoutget_end(lo);

0 commit comments

Comments
 (0)