From: "J. Bruce Fields" <bfields@redhat.com>
To: Steve Dickson <steved@redhat.com>
Cc: linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 4/4] mountd: don't automatically add subexports to kernel cache
Date: Tue, 14 Jun 2011 10:58:12 -0400 [thread overview]
Message-ID: <1308063492-30103-5-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1308063492-30103-1-git-send-email-bfields@redhat.com>
Given a crossmnt export and a child path, search for all mountpoints in
between and add exports for them to the kernel.
This isn't necessary; if the the kernel needs one of the subexports, it
can always ask.
It might be some sort of minor optimization to add exports preemptively.
But if so, why not just add them all? Why this particular subset?
Given the chance to delete some code I can't justify, I'll take it.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
utils/mountd/cache.c | 42 +-----------------------------------------
1 files changed, 1 insertions(+), 41 deletions(-)
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index d2ae4563..c77eb27 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -945,53 +945,13 @@ static int cache_export_ent(char *domain, struct exportent *exp, char *path)
if (!f)
return -1;
- err = dump_to_cache(f, domain, exp->e_path, exp);
+ err = dump_to_cache(f, domain, path, exp);
if (err) {
xlog(L_WARNING,
"Cannot export %s, possibly unsupported filesystem or"
" fsid= required", exp->e_path);
}
- while (err == 0 && (exp->e_flags & NFSEXP_CROSSMOUNT) && path) {
- /* really an 'if', but we can break out of
- * a 'while' more easily */
- /* Look along 'path' for other filesystems
- * and export them with the same options
- */
- struct stat stb;
- size_t l = strlen(exp->e_path);
- __dev_t dev;
-
- if (strlen(path) <= l || path[l] != '/' ||
- strncmp(exp->e_path, path, l) != 0)
- break;
- if (stat(exp->e_path, &stb) != 0)
- break;
- dev = stb.st_dev;
- while(path[l] == '/') {
- char c;
- /* errors for submount should fail whole filesystem */
- int err2;
-
- l++;
- while (path[l] != '/' && path[l])
- l++;
- c = path[l];
- path[l] = 0;
- err2 = lstat(path, &stb);
- path[l] = c;
- if (err2 < 0)
- break;
- if (stb.st_dev == dev)
- continue;
- dev = stb.st_dev;
- path[l] = 0;
- dump_to_cache(f, domain, path, exp);
- path[l] = c;
- }
- break;
- }
-
fclose(f);
return err;
}
--
1.7.4.1
next prev parent reply other threads:[~2011-06-14 14:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 14:58 nfs-utils crossmnt bugfix, and cleanup J. Bruce Fields
2011-06-14 14:58 ` [PATCH 1/4] mountd: prefer explicit subexports over crossmnt parents J. Bruce Fields
2011-06-14 14:58 ` [PATCH 2/4] mountd: gather fsid information into one struct J. Bruce Fields
2011-06-14 14:58 ` [PATCH 3/4] mountd: move fsidtype-specific code to helpers J. Bruce Fields
2011-06-14 14:58 ` J. Bruce Fields [this message]
2011-06-22 22:30 ` [PATCH 4/4] mountd: don't automatically add subexports to kernel cache Steve Dickson
2011-06-22 22:34 ` J. Bruce Fields
2011-06-27 16:36 ` Steve Dickson
2011-06-18 13:27 ` nfs-utils crossmnt bugfix, and cleanup Steve Dickson
2011-06-18 19:50 ` 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=1308063492-30103-5-git-send-email-bfields@redhat.com \
--to=bfields@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.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 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).