Commit 55f84cc4 authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields

nfsd: Schedule the laundrette regularly irrespective of file errors

Emsure we schedule the laundrette even if the struct file is carrying
file errors.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent bd6e1cec
...@@ -237,13 +237,6 @@ nfsd_file_check_write_error(struct nfsd_file *nf) ...@@ -237,13 +237,6 @@ nfsd_file_check_write_error(struct nfsd_file *nf)
return filemap_check_wb_err(file->f_mapping, READ_ONCE(file->f_wb_err)); return filemap_check_wb_err(file->f_mapping, READ_ONCE(file->f_wb_err));
} }
static bool
nfsd_file_in_use(struct nfsd_file *nf)
{
return nfsd_file_check_writeback(nf) ||
nfsd_file_check_write_error(nf);
}
static void static void
nfsd_file_do_unhash(struct nfsd_file *nf) nfsd_file_do_unhash(struct nfsd_file *nf)
{ {
...@@ -307,10 +300,9 @@ void ...@@ -307,10 +300,9 @@ void
nfsd_file_put(struct nfsd_file *nf) nfsd_file_put(struct nfsd_file *nf)
{ {
bool is_hashed = test_bit(NFSD_FILE_HASHED, &nf->nf_flags) != 0; bool is_hashed = test_bit(NFSD_FILE_HASHED, &nf->nf_flags) != 0;
bool unused = !nfsd_file_in_use(nf);
set_bit(NFSD_FILE_REFERENCED, &nf->nf_flags); set_bit(NFSD_FILE_REFERENCED, &nf->nf_flags);
if (nfsd_file_put_noref(nf) == 1 && is_hashed && unused) if (nfsd_file_put_noref(nf) == 1 && is_hashed)
nfsd_file_schedule_laundrette(); nfsd_file_schedule_laundrette();
if (atomic_long_read(&nfsd_filecache_count) >= NFSD_FILE_LRU_LIMIT) if (atomic_long_read(&nfsd_filecache_count) >= NFSD_FILE_LRU_LIMIT)
nfsd_file_gc(); nfsd_file_gc();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment