Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFSv4: retry GETATTR if GET_DIR_DELEGATION failed

Currently, getting a directory delegation is opportinistic and gets
added to an existing GETATTR that's trying to retrieve some needed
attributes. However, GET_DIRDELEGATION can fail and that currently
causes a GETATTR to fail and an error is propagated to the user.

Instead, the original GETATTR should be retried without requesting
a directory delegation. Also, now chosing to clear asking for
the direct delegation for this specific inode.

Fixes: 156b09482933 ("NFS: Request a directory delegation on ACCESS, CREATE, and UNLINK")
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Olga Kornievskaia and committed by
Trond Myklebust
515af100 4fa7ab8d

+8
+8
fs/nfs/nfs4proc.c
··· 4469 4469 case -ENOTSUPP: 4470 4470 case -EOPNOTSUPP: 4471 4471 server->caps &= ~NFS_CAP_DIR_DELEG; 4472 + break; 4473 + case -NFS4ERR_INVAL: 4474 + case -NFS4ERR_IO: 4475 + case -NFS4ERR_DIRDELEG_UNAVAIL: 4476 + case -NFS4ERR_NOTDIR: 4477 + clear_bit(NFS_INO_REQ_DIR_DELEG, &(NFS_I(inode)->flags)); 4478 + status = -EAGAIN; 4472 4479 } 4473 4480 } 4474 4481 ··· 4497 4490 default: 4498 4491 err = nfs4_handle_exception(server, err, &exception); 4499 4492 break; 4493 + case -EAGAIN: 4500 4494 case -ENOTSUPP: 4501 4495 case -EOPNOTSUPP: 4502 4496 exception.retry = true;