From: Richard Yao Subject: [PATCH] [readdir] Return correct inode number of .. directory Date: Thu, 8 Aug 2013 14:42:22 -0400 Message-ID: <1375987342-47197-1-git-send-email-ryao@gentoo.org> Cc: linux-fsdevel@vger.kernel.org, Richard Yao To: Alexander Viro Return-path: Received: from smtp.gentoo.org ([140.211.166.183]:48271 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966123Ab3HHSms (ORCPT ); Thu, 8 Aug 2013 14:42:48 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: dir_emit_dotdot() currently passes parent_ino(file->f_path.dentry) to dir_emit(). Passing a dentry to parent_ino() is wrong. This should have been parent_ino(file->f_path.dentry->i_ino). Signed-off-by: Richard Yao --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 9818747..7495f2e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2717,7 +2717,7 @@ static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx) { return ctx->actor(ctx, "..", 2, ctx->pos, - parent_ino(file->f_path.dentry), DT_DIR) == 0; + parent_ino(file->f_path.dentry->i_ino), DT_DIR) == 0; } static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) { -- 1.8.1.5