Re: [PATCH 2/3] autofs4 - expiring filesystem from under process

Andrew Morton
2005-04-11T07:01:29Z

raven@themaw.net wrote:
>
> static inline int autofs4_ispending(struct dentry *dentry)
> {
> struct autofs_info *inf = autofs4_dentry_ino(dentry);
> + int pending;
>
> - return (dentry->d_flags & DCACHE_AUTOFS_PENDING) ||
> - (inf != NULL && inf->flags & AUTOFS_INF_EXPIRING);
> + if (dentry->d_flags & DCACHE_AUTOFS_PENDING)
> + return 1;
> +
> + if (inf) {
> + spin_lock(&inf->sbi->fs_lock);
> + pending = inf->flags & AUTOFS_INF_EXPIRING;
> + spin_unlock(&inf->sbi->fs_lock);
> + }
> +
> + return pending;

This can obviously return an uninitialised variable.

Were these patches very well tested?