Re: [PATCH]:RESEND : Return proper error value on failure ofdentry_open

From: vibi sreenivasan
Date: Tue Jun 02 2009 - 01:34:42 EST


hi,
Thanks for spending your time on my patch.
> > What bug did you hit?
i was using linus tree & not linux-next.
in that the code fragment was different
it was

file = dentry_open(dentry, mnt, O_RDONLY, current->cred);
rc = get_path_measurement(iint, file, dentry->d_name.name);
}
out:
mutex_unlock(&iint->mutex);
if (file)
fput(file);
kref_put(&iint->refcount, iint_free);
return 0;

So i hit a bug in fput.

My sincere apologies for taking all of yours valuable time.
I will take care that any of my future contributions will be
based on linux-next.

Thanks & Regards
vibi sreenivasan

> if (!(iint->flags & IMA_MEASURED)) {
> struct dentry *dentry = dget(path->dentry);
> struct vfsmount *mnt = mntget(path->mnt);
>
> file = dentry_open(dentry, mnt, O_RDONLY | O_LARGEFILE,
> current_cred());
> if (IS_ERR(file)) {
> pr_info("%s dentry_open failed\n", dentry->d_name.name);
> rc = PTR_ERR(file);
> file = NULL;
> goto out;
> }
> rc = get_path_measurement(iint, file, dentry->d_name.name);
> }
> out:
> mutex_unlock(&iint->mutex);
> if (file)
> fput(file);
> kref_put(&iint->refcount, iint_free);
> return 0;
> }
>
> The handling of `file' looks OK to me.
>
> otoh the function just drops the error code on the floor. Shouldn't it
> return `rc'?
>
>
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/