From fd9097110f74f39bce89ec3a341fd9b686a68719 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 9 May 2007 10:19:33 -0400 Subject: nfs-utils: have mountd hold open etab file to force inode number to change This patch changes mountd to hold the etab file open so that when it's changed by exportfs, the inode number should change. We then change auth_reload to reload the file based on whether st_ino is different from the last time it was checked. It also changes auth_reload to maintain a static counter value and return it instead of a timestamp and fixes up get_exportlist accordingly. Finally, it adds some comments to xtab_write to warn people about editing the etab in place. Signed-off-by: Jeff Layton Signed-off-by: NeilBrown --- support/export/xtab.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'support/export/xtab.c') diff --git a/support/export/xtab.c b/support/export/xtab.c index 0ddb251..292087b 100644 --- a/support/export/xtab.c +++ b/support/export/xtab.c @@ -80,6 +80,12 @@ xtab_export_read(void) return xtab_read(_PATH_ETAB, 1); } +/* + * mountd now keeps an open fd for the etab at all times to make sure that the + * inode number changes when the xtab_export_write is done. If you change the + * routine below such that the files are edited in place, then you'll need to + * fix the auth_reload logic as well... + */ static int xtab_write(char *xtab, char *xtabtmp, int is_export) { -- cgit