Jeff Layton wrote: > On Wed, Apr 25, 2007 at 02:09:34PM -0400, Jeff Layton wrote: >> On Wed, Apr 25, 2007 at 01:39:20PM -0400, Jeff Layton wrote: >>> Currently, when auth_reload is called, it only looks at the tv_sec field >>> of the mtime when deciding whether to invalidate the exports cache. It's >>> fairly simple to fool this by doing something like: >>> >>> # exportfs -rv && rpc.mountd && exportfs -uva && exportfs -iv -o no_root_squash,rw 127.0.0.1:/foo >>> >>> With this, exportfs will show the export for /foo, but mountd will still have >>> whatever contents were in /etc/exports. The issue is that the etab is being >>> updated twice during the same second, and mountd is reading in the file in >>> between updates. When it goes to look at the file again, its timestamp matches >>> the timestamp of the cache, and it ends up keeping the cached contents even >>> though the file has changed. >>> >>> While not all local filesystems provide sub-second timestamps, we might as >>> well fix this problem on those that do. The following patch changes >>> auth_reload to consider the tv_nsec field of the mtime when deciding whether >>> to invalidate the export cache. It also fixes up the callers to pass it a >>> pointer to a struct timespec for it to fill out. >>> >>> I've not yet tested this on a filesystem that provides sub-second timestamps, >>> so I'm not clear on how well this works yet, but it seems to not break >>> anything on ext3 in some cursory testing. >>> >> No sooner than I post than I see a (minor) problem. The check for a NULL >> pointer in auth_reload should be (ts != NULL) instead of (ts). Respun patch >> follows: >> > > I tested this on a filesystem that does nanosecond timestamps (xfs), and it > seems to correct the original problem. Hi Jeff- I don't know much about the export logic, but why not use inode change notification instead of time stamps?