Messages in this thread | | | Subject | Re: [PATCH]:RESEND : Return proper error value on failure of dentry_open | From | vibi sreenivasan <> | Date | Tue, 02 Jun 2009 11:05:40 +0530 |
| |
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'? > > >
| |