Skip to content

Commit cadfc2f

Browse files
Wu BoJaegeuk Kim
authored andcommitted
f2fs: fix args passed to trace_f2fs_lookup_end
The NULL return of 'd_splice_alias' dosen't mean error. Thus the successful case will also return NULL, which makes the tracepoint always print 'err=-ENOENT'. And the different cases of 'new' & 'err' are list as following: 1) dentry exists: err(0) with new(NULL) --> dentry, err=0 2) dentry exists: err(0) with new(VALID) --> new, err=0 3) dentry exists: err(0) with new(ERR) --> dentry, err=ERR 4) no dentry exists: err(-ENOENT) with new(NULL) --> dentry, err=-ENOENT 5) no dentry exists: err(-ENOENT) with new(VALID) --> new, err=-ENOENT 6) no dentry exists: err(-ENOENT) with new(ERR) --> dentry, err=ERR Signed-off-by: Wu Bo <bo.wu@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 38b5783 commit cadfc2f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/f2fs/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
576576
}
577577
#endif
578578
new = d_splice_alias(inode, dentry);
579-
err = PTR_ERR_OR_ZERO(new);
580-
trace_f2fs_lookup_end(dir, dentry, ino, !new ? -ENOENT : err);
579+
trace_f2fs_lookup_end(dir, !IS_ERR_OR_NULL(new) ? new : dentry,
580+
ino, IS_ERR(new) ? PTR_ERR(new) : err);
581581
return new;
582582
out_iput:
583583
iput(inode);

0 commit comments

Comments
 (0)