From: NeilBrown <neilb@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: nfs@lists.sourceforge.net, linux-kernel@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Neil Brown <neilb@suse.de>
Subject: [PATCH 008 of 8] knfsd: nfsd4: don't delegate files that have had conflicts
Date: Thu, 21 Jun 2007 14:31:19 +1000 [thread overview]
Message-ID: <1070621043119.1159@suse.de> (raw)
In-Reply-To: 20070621142604.727.patches@notabene
From: "J. Bruce Fields" <bfields@fieldses.org>
One more incremental delegation policy improvement: don't give out a
delegation on a file if conflicting access has previously required that
a delegation be revoked on that file. (In practice we'll forget about
the conflict when the struct nfs4_file is removed on close, so this is
of limited use for now, though it should at least solve a temporary
problem with self-conflicts on write opens from the same client.)
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
### Diffstat output
./fs/nfsd/nfs4state.c | 4 ++++
./include/linux/nfsd/state.h | 1 +
2 files changed, 5 insertions(+)
diff .prev/fs/nfsd/nfs4state.c ./fs/nfsd/nfs4state.c
--- .prev/fs/nfsd/nfs4state.c 2007-06-21 14:14:47.000000000 +1000
+++ ./fs/nfsd/nfs4state.c 2007-06-21 14:16:21.000000000 +1000
@@ -194,6 +194,8 @@ alloc_init_deleg(struct nfs4_client *clp
struct nfs4_callback *cb = &stp->st_stateowner->so_client->cl_callback;
dprintk("NFSD alloc_init_deleg\n");
+ if (fp->fi_had_conflict)
+ return NULL;
if (num_delegations > max_delegations)
return NULL;
dp = kmem_cache_alloc(deleg_slab, GFP_KERNEL);
@@ -1002,6 +1004,7 @@ alloc_init_file(struct inode *ino)
list_add(&fp->fi_hash, &file_hashtbl[hashval]);
fp->fi_inode = igrab(ino);
fp->fi_id = current_fileid++;
+ fp->fi_had_conflict = false;
return fp;
}
return NULL;
@@ -1328,6 +1331,7 @@ do_recall(void *__dp)
{
struct nfs4_delegation *dp = __dp;
+ dp->dl_file->fi_had_conflict = true;
nfsd4_cb_recall(dp);
return 0;
}
diff .prev/include/linux/nfsd/state.h ./include/linux/nfsd/state.h
--- .prev/include/linux/nfsd/state.h 2007-06-21 14:09:31.000000000 +1000
+++ ./include/linux/nfsd/state.h 2007-06-21 14:16:21.000000000 +1000
@@ -224,6 +224,7 @@ struct nfs4_file {
struct inode *fi_inode;
u32 fi_id; /* used with stateowner->so_id
* for stateid_hashtbl hash */
+ bool fi_had_conflict;
};
/*
next prev parent reply other threads:[~2007-06-21 4:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-21 4:30 [PATCH 000 of 8] knfsd: Assorted nfsv4 server patches NeilBrown
2007-06-21 4:30 ` [PATCH 001 of 8] knfsd: lockd: nfsd4: use same grace period for lockd and nfsd4 NeilBrown
2007-06-21 4:30 ` [PATCH 002 of 8] knfsd: nfsd4: fix NFSv4 filehandle size units confusion NeilBrown
2007-06-21 4:30 ` [PATCH 003 of 8] knfsd: nfsd4: silence a compiler warning in ACL code NeilBrown
2007-06-21 4:30 ` [PATCH 004 of 8] knfsd: nfsd4: fix enc_stateid_sz for nfsd callbacks NeilBrown
2007-06-21 4:30 ` [PATCH 005 of 8] knfsd: nfsd4: fix handling of acl errrors NeilBrown
2007-06-21 4:31 ` [PATCH 006 of 8] knfsd: nfsd: remove unused header interface.h NeilBrown
2007-06-21 4:31 ` [PATCH 007 of 8] knfsd: nfsd4: vary maximum delegation limit based on RAM size NeilBrown
2007-06-21 16:15 ` J. Bruce Fields
2007-06-26 3:52 ` Andrew Morton
2007-06-28 2:15 ` J. Bruce Fields
2007-06-28 2:36 ` Andrew Morton
2007-06-28 2:57 ` J. Bruce Fields
2007-06-28 3:10 ` Andrew Morton
2007-06-21 4:31 ` NeilBrown [this message]
2007-06-21 16:28 ` [PATCH 008 of 8] knfsd: nfsd4: don't delegate files that have had conflicts J. Bruce Fields
2007-06-21 16:33 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1070621043119.1159@suse.de \
--to=neilb@suse.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox