From: "J. Bruce Fields" <bfields@fieldses.org>
To: Andrew Morton <akpm@osdl.org>
Cc: neilb@cse.unsw.edu.au, nfs@lists.sourceforge.net,
"Philippe Gramoullé" <philippe.gramoulle@mmania.com>
Subject: Re: Re: [PATCH] kNFSd - 2 of 5 - ip_map_init does a kmalloc which isn't checked...
Date: Mon, 9 Feb 2004 16:51:51 -0500 [thread overview]
Message-ID: <20040209215151.GE2776@fieldses.org> (raw)
In-Reply-To: <20040209093206.429ffb7e.akpm@osdl.org>
On Mon, Feb 09, 2004 at 09:32:06AM -0800, Andrew Morton wrote:
> Bruce, 2.6.3-rc1-mm1 contains your later batch of patches (02 and 03 are
> still in the wrong order, but that doesn't matter and I have subsequently
> fixed that).
The version of nfsd-03-sunrpc-cache-init-fixes.patch in 2.6.3-rc1-mm1
isn't the one I sent; note that the only change I made was to add a few
lines to net/sunrpc/svcauth.c (a file that that patch didn't modify
before), and that chunk isn't in there.
--Bruce Fields
include/linux/sunrpc/cache.h | 13 ++++++++-----
net/sunrpc/svcauth.c | 6 +++++-
2 files changed, 13 insertions(+), 6 deletions(-)
diff -puN include/linux/sunrpc/cache.h~neil_NfsdCacheImprove include/linux/sunrpc/cache.h
--- linux-2.6.1/include/linux/sunrpc/cache.h~neil_NfsdCacheImprove 2004-02-08 13:54:41.000000000 -0500
+++ linux-2.6.1-bfields/include/linux/sunrpc/cache.h 2004-02-08 13:54:41.000000000 -0500
@@ -130,12 +130,14 @@ struct cache_deferred_req {
* If "set" == 0 :
* If an entry is found, it is returned
* If no entry is found, a new non-VALID entry is created.
- * If "set" == 1 :
+ * If "set" == 1 and INPLACE == 0 :
* If no entry is found a new one is inserted with data from "template"
* If a non-CACHE_VALID entry is found, it is updated from template using UPDATE
* If a CACHE_VALID entry is found, a new entry is swapped in with data
* from "template"
- * If set == 2, we UPDATE, but don't swap. i.e. update in place
+ * If set == 1, and INPLACE == 1 :
+ * As above, except that if a CACHE_VALID entry is found, we UPDATE in place
+ * instead of swapping in a new entry.
*
* If the passed handle has the CACHE_NEGATIVE flag set, then UPDATE is not
* run but insteead CACHE_NEGATIVE is set in any new item.
@@ -162,8 +164,8 @@ RTN *FNAME ARGS \
RTN *tmp, *new=NULL; \
struct cache_head **hp, **head; \
SETUP; \
- retry: \
head = &(DETAIL)->hash_table[HASHFN]; \
+ retry: \
if (set||new) write_lock(&(DETAIL)->hash_lock); \
else read_lock(&(DETAIL)->hash_lock); \
for(hp=head; *hp != NULL; hp = &tmp->MEMBER.next) { \
@@ -173,6 +175,8 @@ RTN *FNAME ARGS \
if (set && !INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags) && !new) \
break; \
\
+ if (new) \
+ {INIT;} \
cache_get(&tmp->MEMBER); \
if (set) { \
if (!INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags))\
@@ -201,6 +205,7 @@ RTN *FNAME ARGS \
} \
/* Didn't find anything */ \
if (new) { \
+ INIT; \
new->MEMBER.next = *head; \
*head = &new->MEMBER; \
(DETAIL)->entries ++; \
@@ -222,8 +227,6 @@ RTN *FNAME ARGS \
if (new) { \
cache_init(&new->MEMBER); \
cache_get(&new->MEMBER); \
- INIT; \
- tmp = new; \
goto retry; \
} \
return NULL; \
diff -puN net/sunrpc/svcauth.c~neil_NfsdCacheImprove net/sunrpc/svcauth.c
--- linux-2.6.1/net/sunrpc/svcauth.c~neil_NfsdCacheImprove 2004-02-08 13:54:41.000000000 -0500
+++ linux-2.6.1-bfields/net/sunrpc/svcauth.c 2004-02-08 14:09:08.000000000 -0500
@@ -150,7 +150,11 @@ DefineCacheLookup(struct auth_domain,
&auth_domain_cache,
auth_domain_hash(item),
auth_domain_match(tmp, item),
- kfree(new); if(!set) return NULL;
+ kfree(new); if(!set) {
+ if (new) write_unlock(&auth_domain_cache.hash_lock);
+ else read_unlock(&auth_domain_cache.hash_lock);
+ return NULL;
+ }
new=item; atomic_inc(&new->h.refcnt),
/* no update */,
0 /* no inplace updates */
_
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2004-02-10 0:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-06 5:13 [PATCH] kNFSd - 0 of 5 - Introduction NeilBrown
2004-02-06 5:13 ` [PATCH] kNFSd - 1 of 5 - Fix possible scheduling_while_atomic in cache.c NeilBrown
2004-02-06 5:13 ` [PATCH] kNFSd - 2 of 5 - ip_map_init does a kmalloc which isn't checked NeilBrown
2004-02-07 9:24 ` Andrew Morton
2004-02-08 4:37 ` J. Bruce Fields
2004-02-08 5:46 ` Andrew Morton
2004-02-08 5:59 ` J. Bruce Fields
2004-02-08 20:30 ` J. Bruce Fields
2004-02-08 20:38 ` [PATCH] kNFSd - 1 of 5 - Fix possible scheduling_while_atomic in cache.c J. Bruce Fields
2004-02-08 20:41 ` [PATCH] kNFSd - 2 of 5 - Allow sunrpc/svc cache init function to modify the "key" J. Bruce Fields
2004-02-08 20:43 ` [PATCH] kNFSd - 3 of 5 - ip_map_init does a kmalloc which isn't checked J. Bruce Fields
2004-02-08 20:46 ` [PATCH] kNFSd - 4 of 5 - convert NFS /proc interfaces to seq_file J. Bruce Fields
2004-02-08 20:48 ` [PATCH] kNFSd - 5 of 5 - fix build problems in nfs w/o proc_fs J. Bruce Fields
2004-02-09 17:32 ` Re: [PATCH] kNFSd - 2 of 5 - ip_map_init does a kmalloc which isn't checked Andrew Morton
2004-02-09 21:51 ` J. Bruce Fields [this message]
2004-02-09 22:10 ` Andrew Morton
2004-02-06 5:13 ` [PATCH] kNFSd - 3 of 5 - Allow sunrpc/svc cache init function to modify the "key" NeilBrown
2004-02-07 9:30 ` Andrew Morton
2004-02-06 5:13 ` [PATCH] kNFSd - 4 of 5 - convert NFS /proc interfaces to seq_file NeilBrown
2004-02-06 5:13 ` [PATCH] kNFSd - 5 of 5 - fix build problems in nfs w/o proc_fs on 2.6.0-test5 NeilBrown
2004-02-06 5:32 ` [PATCH] kNFSd - 0 of 5 - Introduction Andrew Morton
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=20040209215151.GE2776@fieldses.org \
--to=bfields@fieldses.org \
--cc=akpm@osdl.org \
--cc=neilb@cse.unsw.edu.au \
--cc=nfs@lists.sourceforge.net \
--cc=philippe.gramoulle@mmania.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.