1 diff -urN linux.orig/fs/lockd/svc.c linux/fs/lockd/svc.c
2 --- linux.orig/fs/lockd/svc.c Sun Mar 25 18:37:38 2001
3 +++ linux/fs/lockd/svc.c Sat Mar 9 19:03:43 2002
6 #define NLMDBG_FACILITY NLMDBG_SVC
7 #define LOCKD_BUFSIZE (1024 + NLMSSVC_XDRSIZE)
8 -#define ALLOWED_SIGS (sigmask(SIGKILL))
9 +#define ALLOWED_SIGS (sigmask(SIGKILL|SIGTERM))
11 extern struct svc_program nlmsvc_program;
12 struct nlmsvc_binding * nlmsvc_ops = NULL;
15 /* Process request with signals blocked. */
16 spin_lock_irq(¤t->sigmask_lock);
17 - siginitsetinv(¤t->blocked, sigmask(SIGKILL));
18 + siginitsetinv(¤t->blocked, sigmask(SIGKILL|SIGTERM));
19 recalc_sigpending(current);
20 spin_unlock_irq(¤t->sigmask_lock);
23 * NFS mount or NFS daemon has gone away, and we've been sent a
24 * signal, or else another process has taken over our job.
26 - while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid)
27 + while ((nlmsvc_users>1 || !signalled()) && nlmsvc_pid == current->pid)
29 long timeout = MAX_SCHEDULE_TIMEOUT;
32 if (!nlmsvc_pid || current->pid == nlmsvc_pid) {
38 "lockd: new process, skipping host shutdown\n");
39 diff -urN linux.orig/fs/nfsd/nfsfh.c linux/fs/nfsd/nfsfh.c
40 --- linux.orig/fs/nfsd/nfsfh.c Sat Mar 9 13:03:12 2002
41 +++ linux/fs/nfsd/nfsfh.c Sat Mar 9 18:58:42 2002
46 +/* Arrange a dentry for the given inode:
47 + * 1. Prefer an existing connected dentry.
48 + * 2. Settle for an existing disconnected dentry.
49 + * 3. If necessary, create a (disconnected) dentry.
51 +static struct dentry *nfsd_arrange_dentry(struct inode *inode)
53 + struct list_head *lp;
54 + struct dentry *result;
57 + for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) {
58 + result = list_entry(lp,struct dentry, d_alias);
59 + if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED))
66 + result = d_alloc_root(inode, NULL);
69 + return ERR_PTR(-ENOMEM);
71 + result->d_flags |= DCACHE_NFSD_DISCONNECTED;
72 + d_rehash(result); /* so a dput won't loose it */
77 /* this should be provided by each filesystem in an nfsd_operations interface as
78 * iget isn't really the right interface
81 * so a generation of 0 means "accept any"
84 - struct list_head *lp;
85 - struct dentry *result;
86 inode = iget_in_use(sb, ino, &locality);
88 dprintk("nfsd_iget: failed to find ino: %lu on %s\n",
91 return ERR_PTR(-ESTALE);
93 - /* now to find a dentry.
94 - * If possible, get a well-connected one
96 - for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) {
97 - result = list_entry(lp,struct dentry, d_alias);
98 - if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
104 - result = d_alloc_root(inode, NULL);
105 - if (result == NULL) {
107 - return ERR_PTR(-ENOMEM);
109 - result->d_flags |= DCACHE_NFSD_DISCONNECTED;
110 - d_rehash(result); /* so a dput won't loose it */
113 + return nfsd_arrange_dentry(inode);
116 /* this routine links an IS_ROOT dentry into the dcache tree. It gains "parent"
117 @@ -227,45 +239,28 @@
119 struct dentry *nfsd_findparent(struct dentry *child)
121 - struct dentry *tdentry, *pdentry;
122 - tdentry = d_alloc(child, &(const struct qstr) {"..", 2, 0});
124 + struct dentry *dotdot, *parent;
126 + dotdot = d_alloc(child, &(const struct qstr) {"..", 2, 0});
128 return ERR_PTR(-ENOMEM);
130 /* I'm going to assume that if the returned dentry is different, then
131 * it is well connected. But nobody returns different dentrys do they?
133 - pdentry = child->d_inode->i_op->lookup(child->d_inode, tdentry);
134 - d_drop(tdentry); /* we never want ".." hashed */
136 - /* I don't want to return a ".." dentry.
137 - * I would prefer to return an unconnected "IS_ROOT" dentry,
138 - * though a properly connected dentry is even better
140 - /* if first or last of alias list is not tdentry, use that
141 - * else make a root dentry
143 - struct list_head *aliases = &tdentry->d_inode->i_dentry;
144 - if (aliases->next != aliases) {
145 - pdentry = list_entry(aliases->next, struct dentry, d_alias);
146 - if (pdentry == tdentry)
147 - pdentry = list_entry(aliases->prev, struct dentry, d_alias);
148 - if (pdentry == tdentry)
150 - if (pdentry) dget(pdentry);
152 - if (pdentry == NULL) {
153 - pdentry = d_alloc_root(igrab(tdentry->d_inode), NULL);
155 - pdentry->d_flags |= DCACHE_NFSD_DISCONNECTED;
159 - if (pdentry == NULL)
160 - pdentry = ERR_PTR(-ENOMEM);
161 + parent = child->d_inode->i_op->lookup(child->d_inode, dotdot);
162 + d_drop(dotdot); /* we never want ".." hashed */
165 + dput(dotdot); /* not hashed, thus discarded */
167 + /* Discard the ".." dentry, then arrange for a better one */
168 + struct inode *inode = igrab(dotdot->d_inode);
169 + dput(dotdot); /* not hashed, thus discarded */
170 + parent = nfsd_arrange_dentry(inode);
173 - dput(tdentry); /* it is not hashed, it will be discarded */
178 static struct dentry *splice(struct dentry *child, struct dentry *parent)