Skip to content

Commit

Permalink
pNFS: Remove unwanted optimisation of layoutget
Browse files Browse the repository at this point in the history
If we knew that the file was empty, we wouldn't be asking for a layout.
Any optimisation here is already done before calling pnfs_update_layout().
As it stands, we sometimes end up doing an unnecessary inband read to
the MDS even when holding a layout.

Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
  • Loading branch information
trondmy authored and amschuma-ntap committed Aug 21, 2018
1 parent 1c1aeaf commit 0af4c8b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1823,12 +1823,6 @@ pnfs_update_layout(struct inode *ino,
goto out;
}

if (iomode == IOMODE_READ && i_size_read(ino) == 0) {
trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg,
PNFS_UPDATE_LAYOUT_RD_ZEROLEN);
goto out;
}

if (pnfs_within_mdsthreshold(ctx, ino, iomode)) {
trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg,
PNFS_UPDATE_LAYOUT_MDSTHRESH);
Expand Down

0 comments on commit 0af4c8b

Please sign in to comment.