On Thu, Sep 19, 2019 at 11:36:28AM +0800, zhengbin (A) wrote: > >> + dput(to); > >> dput(to) should be in if if (file->f_pos > 2)? cause we dget(to) in scan_positives > > dput(NULL) is a no-op > > + spin_unlock(&dentry->d_lock); > + dput(*res); > + *res = found; > + return p; > > dput(*res) should be removed? Huh? Why would it? We drop the original reference and replace it with the new one; what's the problem?