* linux-next: manual merge of the nfsd tree with Linus' tree
@ 2013-04-03 0:01 Stephen Rothwell
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2013-04-03 0:01 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: linux-next, linux-kernel, Jeff Layton
[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]
Hi,
Today's linux-next merge of the nfsd tree got a conflict in
fs/nfsd/nfscache.c between commit a517b608fa3d ("nfsd: only unhash DRC
entries that are in the hashtable") from Linus' tree and commit
559aa350587e ("nfsd: track memory utilization in the DRC") from the nfsd
tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc fs/nfsd/nfscache.c
index ca05f6d,3af1767..0000000
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@@ -100,12 -130,14 +130,15 @@@ nfsd_reply_cache_alloc(void
static void
nfsd_reply_cache_free_locked(struct svc_cacherep *rp)
{
- if (rp->c_type == RC_REPLBUFF)
+ if (rp->c_type == RC_REPLBUFF && rp->c_replvec.iov_base) {
+ drc_mem_usage -= rp->c_replvec.iov_len;
kfree(rp->c_replvec.iov_base);
+ }
- hlist_del(&rp->c_hash);
+ if (!hlist_unhashed(&rp->c_hash))
+ hlist_del(&rp->c_hash);
list_del(&rp->c_lru);
--num_drc_entries;
+ drc_mem_usage -= sizeof(*rp);
kmem_cache_free(drc_slab, rp);
}
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: manual merge of the nfsd tree with Linus' tree
2015-07-30 1:35 ` Trond Myklebust
@ 2015-07-30 2:12 ` J. Bruce Fields
0 siblings, 0 replies; 7+ messages in thread
From: J. Bruce Fields @ 2015-07-30 2:12 UTC (permalink / raw)
To: Trond Myklebust
Cc: Stephen Rothwell, Linux Next Mailing List, Linux Kernel Mailing List
On Wed, Jul 29, 2015 at 09:35:11PM -0400, Trond Myklebust wrote:
> Hi Stephen,
>
> On Wed, Jul 29, 2015 at 9:23 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > Hi all,
> >
> > Today's linux-next merge of the nfsd tree got a conflict in:
> >
> > fs/nfs/nfs42proc.c
> >
> > between commit:
> >
> > bdcc2cd14e4e ("NFSv4.2: handle NFS-specific llseek errors")
> >
> > from Linus' tree and commit:
> >
> > 0183ae17c741 ("NFSv4.2: handle NFS-specific llseek errors")
> >
> > from the nfsd tree.
> >
> > The only difference here is that _nfs42_proc_llseek is static in the
> > former, so I used that.
Whoops, thanks, I shouldn't have even had that one in my tree....
> Yes, I snuck that declaration into the patch since it was obvious that
> we would never want to export _nfs42_proc_llseek(), and because
> "sparse" complained. Apologies if that caused a conflict...
I actually noticed that, then noticed a bunch of other stuff there had
the same problem, then started to make a patch to fix all those in one
fell swoop, then decided I was being annoying and dropped it.
Um.
--b.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: manual merge of the nfsd tree with Linus' tree
2015-07-30 1:23 Stephen Rothwell
@ 2015-07-30 1:35 ` Trond Myklebust
2015-07-30 2:12 ` J. Bruce Fields
0 siblings, 1 reply; 7+ messages in thread
From: Trond Myklebust @ 2015-07-30 1:35 UTC (permalink / raw)
To: Stephen Rothwell
Cc: J. Bruce Fields, Linux Next Mailing List, Linux Kernel Mailing List
Hi Stephen,
On Wed, Jul 29, 2015 at 9:23 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> Today's linux-next merge of the nfsd tree got a conflict in:
>
> fs/nfs/nfs42proc.c
>
> between commit:
>
> bdcc2cd14e4e ("NFSv4.2: handle NFS-specific llseek errors")
>
> from Linus' tree and commit:
>
> 0183ae17c741 ("NFSv4.2: handle NFS-specific llseek errors")
>
> from the nfsd tree.
>
> The only difference here is that _nfs42_proc_llseek is static in the
> former, so I used that.
>
Yes, I snuck that declaration into the patch since it was obvious that
we would never want to export _nfs42_proc_llseek(), and because
"sparse" complained. Apologies if that caused a conflict...
Cheers
Trond
^ permalink raw reply [flat|nested] 7+ messages in thread
* linux-next: manual merge of the nfsd tree with Linus' tree
@ 2015-07-30 1:23 Stephen Rothwell
2015-07-30 1:35 ` Trond Myklebust
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2015-07-30 1:23 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: linux-next, linux-kernel, Trond Myklebust
Hi all,
Today's linux-next merge of the nfsd tree got a conflict in:
fs/nfs/nfs42proc.c
between commit:
bdcc2cd14e4e ("NFSv4.2: handle NFS-specific llseek errors")
from Linus' tree and commit:
0183ae17c741 ("NFSv4.2: handle NFS-specific llseek errors")
from the nfsd tree.
The only difference here is that _nfs42_proc_llseek is static in the
former, so I used that.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
^ permalink raw reply [flat|nested] 7+ messages in thread
* linux-next: manual merge of the nfsd tree with Linus' tree
@ 2014-01-29 1:42 Stephen Rothwell
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2014-01-29 1:42 UTC (permalink / raw)
To: J. Bruce Fields, Al Viro
Cc: linux-next, linux-kernel, Christoph Hellwig, Linus
[-- Attachment #1: Type: text/plain, Size: 1828 bytes --]
Hi all,
Today's linux-next merge of the nfsd tree got a conflict in
fs/nfsd/nfs4acl.c between commit 4ac7249ea5a0 ("nfsd: use get_acl and
->set_acl") from Linus' tree and commit 3554116d3aae ("nfsd4: simplify
xdr encoding of nfsv4 names") from the nfsd tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc fs/nfsd/nfs4acl.c
index 649ad7cf2204,eea24c9a561d..000000000000
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@@ -37,13 -37,9 +37,14 @@@
#include <linux/slab.h>
#include <linux/nfs_fs.h>
#include <linux/export.h>
+#include "nfsfh.h"
+ #include "nfsd.h"
#include "acl.h"
+#include "vfs.h"
+#define NFS4_ACL_TYPE_DEFAULT 0x01
+#define NFS4_ACL_DIR 0x02
+#define NFS4_ACL_OWNER 0x04
/* mode bit translations: */
#define NFS4_READ_MODE (NFS4_ACE_READ_DATA)
@@@ -916,17 -849,26 +917,22 @@@ nfs4_acl_get_whotype(char *p, u32 len
return NFS4_ACL_WHO_NAMED;
}
- int
- nfs4_acl_write_who(int who, char *p)
+ __be32 nfs4_acl_write_who(int who, __be32 **p, int *len)
{
int i;
+ int bytes;
for (i = 0; i < ARRAY_SIZE(s2t_map); i++) {
- if (s2t_map[i].type == who) {
- memcpy(p, s2t_map[i].string, s2t_map[i].stringlen);
- return s2t_map[i].stringlen;
- }
+ if (s2t_map[i].type != who)
+ continue;
+ bytes = 4 + (XDR_QUADLEN(s2t_map[i].stringlen) << 2);
+ if (bytes > *len)
+ return nfserr_resource;
+ *p = xdr_encode_opaque(*p, s2t_map[i].string,
+ s2t_map[i].stringlen);
+ *len -= bytes;
+ return 0;
}
- BUG();
+ WARN_ON_ONCE(1);
return -1;
}
-
-EXPORT_SYMBOL(nfs4_acl_new);
-EXPORT_SYMBOL(nfs4_acl_get_whotype);
-EXPORT_SYMBOL(nfs4_acl_write_who);
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* linux-next: manual merge of the nfsd tree with Linus' tree
@ 2013-03-01 0:49 Stephen Rothwell
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2013-03-01 0:49 UTC (permalink / raw)
To: J. Bruce Fields
Cc: linux-next, linux-kernel, Sasha Levin, Andrew Morton, Jeff Layton
[-- Attachment #1: Type: text/plain, Size: 4683 bytes --]
Hi all,
Today's linux-next merge of the nfsd tree got a conflict in
fs/nfsd/nfscache.c between commit b67bfe0d42ca ("hlist: drop the node
parameter from iterators") from Linus' tree and commit a4a3ec329124
("nfsd: break out hashtable search into separate function") from the nfsd
tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc fs/nfsd/nfscache.c
index da3dbd0,ca43664..0000000
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@@ -112,10 -182,130 +182,129 @@@ hash_refile(struct svc_cacherep *rp
hlist_add_head(&rp->c_hash, cache_hash + request_hash(rp->c_xid));
}
+ static inline bool
+ nfsd_cache_entry_expired(struct svc_cacherep *rp)
+ {
+ return rp->c_state != RC_INPROG &&
+ time_after(jiffies, rp->c_timestamp + RC_EXPIRE);
+ }
+
+ /*
+ * Walk the LRU list and prune off entries that are older than RC_EXPIRE.
+ * Also prune the oldest ones when the total exceeds the max number of entries.
+ */
+ static void
+ prune_cache_entries(void)
+ {
+ struct svc_cacherep *rp, *tmp;
+
+ list_for_each_entry_safe(rp, tmp, &lru_head, c_lru) {
+ if (!nfsd_cache_entry_expired(rp) &&
+ num_drc_entries <= max_drc_entries)
+ break;
+ nfsd_reply_cache_free_locked(rp);
+ }
+
+ /*
+ * Conditionally rearm the job. If we cleaned out the list, then
+ * cancel any pending run (since there won't be any work to do).
+ * Otherwise, we rearm the job or modify the existing one to run in
+ * RC_EXPIRE since we just ran the pruner.
+ */
+ if (list_empty(&lru_head))
+ cancel_delayed_work(&cache_cleaner);
+ else
+ mod_delayed_work(system_wq, &cache_cleaner, RC_EXPIRE);
+ }
+
+ static void
+ cache_cleaner_func(struct work_struct *unused)
+ {
+ spin_lock(&cache_lock);
+ prune_cache_entries();
+ spin_unlock(&cache_lock);
+ }
+
+ static int
+ nfsd_reply_cache_shrink(struct shrinker *shrink, struct shrink_control *sc)
+ {
+ unsigned int num;
+
+ spin_lock(&cache_lock);
+ if (sc->nr_to_scan)
+ prune_cache_entries();
+ num = num_drc_entries;
+ spin_unlock(&cache_lock);
+
+ return num;
+ }
+
+ /*
+ * Walk an xdr_buf and get a CRC for at most the first RC_CSUMLEN bytes
+ */
+ static __wsum
+ nfsd_cache_csum(struct svc_rqst *rqstp)
+ {
+ int idx;
+ unsigned int base;
+ __wsum csum;
+ struct xdr_buf *buf = &rqstp->rq_arg;
+ const unsigned char *p = buf->head[0].iov_base;
+ size_t csum_len = min_t(size_t, buf->head[0].iov_len + buf->page_len,
+ RC_CSUMLEN);
+ size_t len = min(buf->head[0].iov_len, csum_len);
+
+ /* rq_arg.head first */
+ csum = csum_partial(p, len, 0);
+ csum_len -= len;
+
+ /* Continue into page array */
+ idx = buf->page_base / PAGE_SIZE;
+ base = buf->page_base & ~PAGE_MASK;
+ while (csum_len) {
+ p = page_address(buf->pages[idx]) + base;
+ len = min_t(size_t, PAGE_SIZE - base, csum_len);
+ csum = csum_partial(p, len, csum);
+ csum_len -= len;
+ base = 0;
+ ++idx;
+ }
+ return csum;
+ }
+
+ /*
+ * Search the request hash for an entry that matches the given rqstp.
+ * Must be called with cache_lock held. Returns the found entry or
+ * NULL on failure.
+ */
+ static struct svc_cacherep *
+ nfsd_cache_search(struct svc_rqst *rqstp, __wsum csum)
+ {
+ struct svc_cacherep *rp;
- struct hlist_node *hn;
+ struct hlist_head *rh;
+ __be32 xid = rqstp->rq_xid;
+ u32 proto = rqstp->rq_prot,
+ vers = rqstp->rq_vers,
+ proc = rqstp->rq_proc;
+
+ rh = &cache_hash[request_hash(xid)];
- hlist_for_each_entry(rp, hn, rh, c_hash) {
++ hlist_for_each_entry(rp, rh, c_hash) {
+ if (xid == rp->c_xid && proc == rp->c_proc &&
+ proto == rp->c_prot && vers == rp->c_vers &&
+ rqstp->rq_arg.len == rp->c_len && csum == rp->c_csum &&
+ rpc_cmp_addr(svc_addr(rqstp), (struct sockaddr *)&rp->c_addr) &&
+ rpc_get_port(svc_addr(rqstp)) == rpc_get_port((struct sockaddr *)&rp->c_addr))
+ return rp;
+ }
+ return NULL;
+ }
+
/*
* Try to find an entry matching the current call in the cache. When none
- * is found, we grab the oldest unlocked entry off the LRU list.
- * Note that no operation within the loop may sleep.
+ * is found, we try to grab the oldest expired entry off the LRU list. If
+ * a suitable one isn't there, then drop the cache_lock and allocate a
+ * new one, then search again in case one got inserted while this thread
+ * didn't hold the lock.
*/
int
nfsd_cache_lookup(struct svc_rqst *rqstp)
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* linux-next: manual merge of the nfsd tree with Linus' tree
@ 2011-01-06 0:47 Stephen Rothwell
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2011-01-06 0:47 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: linux-next, linux-kernel, Christoph Hellwig
Hi all,
Today's linux-next merge of the nfsd tree got a conflict in
Documentation/filesystems/Locking between commit
b83be6f20a0e468f715b14225c9f897538dfe5ad ("update
Documentation/filesystems/Locking") from Linus' tree and commit
e63eb9375089f9d2041305d04c3f33a194e0e014 ("nfsd4: eliminate lease delete
callback") from the nfsd tree.
I fixed it up (see below) and can carry the fix as necessary.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc Documentation/filesystems/Locking
index 33fa3e5,075be12..0000000
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@@ -337,22 -327,17 +337,20 @@@ fl_release_private: maybe n
prototypes:
int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
void (*fl_notify)(struct file_lock *); /* unblock callback */
+ int (*fl_grant)(struct file_lock *, struct file_lock *, int);
- void (*fl_release_private)(struct file_lock *);
void (*fl_break)(struct file_lock *); /* break_lease callback */
+ int (*fl_mylease)(struct file_lock *, struct file_lock *);
+ int (*fl_change)(struct file_lock **, int);
locking rules:
- BKL may block
-fl_compare_owner: yes no
-fl_notify: yes no
-fl_break: yes no
-
- Currently only NFSD and NLM provide instances of this class. None of the
-them block. If you have out-of-tree instances - please, show up. Locking
-in that area will change.
+ file_lock_lock may block
+fl_compare_owner: yes no
+fl_notify: yes no
+fl_grant: no no
- fl_release_private: maybe no
+fl_break: yes no
+fl_mylease: yes no
+fl_change yes no
+
--------------------------- buffer_head -----------------------------------
prototypes:
void (*b_end_io)(struct buffer_head *bh, int uptodate);
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-07-30 2:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-03 0:01 linux-next: manual merge of the nfsd tree with Linus' tree Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2015-07-30 1:23 Stephen Rothwell
2015-07-30 1:35 ` Trond Myklebust
2015-07-30 2:12 ` J. Bruce Fields
2014-01-29 1:42 Stephen Rothwell
2013-03-01 0:49 Stephen Rothwell
2011-01-06 0:47 Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).