Revision 227823d2074da0c138d2abc0074b2dd281bbf923 authored by Dai Ngo on 23 January 2020, 01:45:39 UTC, committed by Anna Schumaker on 04 February 2020, 15:50:44 UTC
When the directory is large and it's being modified by one client
while another client is doing the 'ls -l' on the same directory then
the cache page invalidation from nfs_force_use_readdirplus causes
the reading client to keep restarting READDIRPLUS from cookie 0
which causes the 'ls -l' to take a very long time to complete,
possibly never completing.

Currently when nfs_force_use_readdirplus is called to switch from
READDIR to READDIRPLUS, it invalidates all the cached pages of the
directory. This cache page invalidation causes the next nfs_readdir
to re-read the directory content from cookie 0.

This patch is to optimise the cache invalidation in
nfs_force_use_readdirplus by only truncating the cached pages from
last page index accessed to the end the file. It also marks the
inode to delay invalidating all the cached page of the directory
until the next initial nfs_readdir of the next 'ls' instance.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Reviewed-by: Trond Myklebust <trond.myklebust@hammerspace.com>
[Anna - Fix conflicts with Trond's readdir patches]
[Anna - Remove redundant call to nfs_zap_mapping()]
[Anna - Replace d_inode(file_dentry(desc->file)) with file_inode(desc->file)]
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 93a6ab7
History
File Mode Size
crush
Kconfig -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 449 bytes
armor.c -rw-r--r-- 1.9 KB
auth.c -rw-r--r-- 7.9 KB
auth_none.c -rw-r--r-- 3.1 KB
auth_none.h -rw-r--r-- 502 bytes
auth_x.c -rw-r--r-- 23.1 KB
auth_x.h -rw-r--r-- 1013 bytes
auth_x_protocol.h -rw-r--r-- 1.9 KB
buffer.c -rw-r--r-- 1.2 KB
ceph_common.c -rw-r--r-- 20.1 KB
ceph_fs.c -rw-r--r-- 2.6 KB
ceph_hash.c -rw-r--r-- 2.9 KB
ceph_strings.c -rw-r--r-- 1.2 KB
cls_lock_client.c -rw-r--r-- 11.5 KB
crypto.c -rw-r--r-- 7.9 KB
crypto.h -rw-r--r-- 1.0 KB
debugfs.c -rw-r--r-- 12.2 KB
decode.c -rw-r--r-- 2.0 KB
messenger.c -rw-r--r-- 88.3 KB
mon_client.c -rw-r--r-- 33.2 KB
msgpool.c -rw-r--r-- 2.3 KB
osd_client.c -rw-r--r-- 145.9 KB
osdmap.c -rw-r--r-- 60.3 KB
pagelist.c -rw-r--r-- 4.0 KB
pagevec.c -rw-r--r-- 3.3 KB
snapshot.c -rw-r--r-- 1.6 KB
string_table.c -rw-r--r-- 2.2 KB
striper.c -rw-r--r-- 7.7 KB

back to top