On Mon, Apr 17, 2017 at 3:33 PM, Rock Lee <rockdotlee@xxxxxxxxx> wrote: > Hi, Amir: > >> +static int ovl_set_redirect_fh(struct dentry *dentry, struct dentry *upper) >> +{ >> + int err; >> + const struct ovl_fh *fh; >> + >> + fh = ovl_get_redirect_fh(ovl_dentry_lower(dentry)); >> + err = PTR_ERR(fh); >> + if (IS_ERR(fh)) >> + goto out_err; >> + >> + err = ovl_do_setxattr(upper, OVL_XATTR_FH, fh, fh->len, 0); >> + if (err) >> + goto out_free; > > I'm not quite sure, maybe you missed a 'free(fh)' here. It's right there at out_free :) Thanks for reviewing! > >> + return 0; >> + >> +out_free: >> + kfree(fh); >> +out_err: >> + if (err == -EOPNOTSUPP) { >> + ovl_clear_redirect_fh(dentry->d_sb); >> + return 0; >> + } >> + pr_warn_ratelimited("overlay: failed to set redirect fh (%i)\n", err); >> + return err; >> +} >> + > > > > > > > -- > Cheers, > Rock