From patchwork Tue Sep 17 15:08:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: boxi liu X-Patchwork-Id: 275489 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6BEFE2C0086 for ; Wed, 18 Sep 2013 01:08:54 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752827Ab3IQPIw (ORCPT ); Tue, 17 Sep 2013 11:08:52 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:55099 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627Ab3IQPIv convert rfc822-to-8bit (ORCPT ); Tue, 17 Sep 2013 11:08:51 -0400 Received: by mail-ie0-f170.google.com with SMTP id x13so10533893ief.15 for ; Tue, 17 Sep 2013 08:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=pTktk9CxnOCprtmCUuGQeLgGsN3FuwcvaUn/SUKTJvQ=; b=j2yhFJz3P1JtU3GK9fhbLG15ZXYHjuHaU9x7y7uE9wrutsOrxIuh4VX+8k7bnFzi7S yna1u+j9ozyCjivlUzIm+3j5vqwiRlhBhpnJug/BMpPOWR0ON0SdjdNtYd9+vyuhZXI7 KKp+5vDFAZhchSPCyT/jAP51dq/kQSbRQNSGDE2Bodsf9dRC7dOJzeh2p5wMkObRmtMr PIDWbd8o1SVak3b03rIrszpT24oxnCbcuovpDRH6W9RTybl/TSJqNxBQBK4fcCx36xeA awqLwRdE3o0qQ+vAoaGw3cbIvQUwDOLQr3sc2cySfJXlAL2iDPu4bIXHES6RBgRtENNH 7BYw== MIME-Version: 1.0 X-Received: by 10.43.125.4 with SMTP id gq4mr9121129icc.1.1379430531141; Tue, 17 Sep 2013 08:08:51 -0700 (PDT) Received: by 10.64.128.233 with HTTP; Tue, 17 Sep 2013 08:08:51 -0700 (PDT) Date: Tue, 17 Sep 2013 23:08:51 +0800 Message-ID: Subject: fix the ext4_read_inline_dir return value From: Boxi Liu To: "linux-ext4@vger.kernel.org" , Theodore Tso , Robin Dong , "tm@tao.ma" , "lewis.liulei" , pamirs Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org hi, there may be a bug in ext4_read_inline_dir() function with inline_data feature. when I recursion call a sys_old_readdir to read a direntry's sub_dentry,I find that the ext4_read_inline_dir return the len of the inline_data ,but in the no inline_data case,it will return 0.It is inconsistent. So I try to make a patch to fix it. --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index d9ecbf1..3ea39cd 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1441,7 +1441,7 @@ int ext4_read_inline_dir(struct file *file, up_read(&EXT4_I(inode)->xattr_sem); if (ret < 0) goto out; - + ret = 0; sb = inode->i_sb; parent_ino = le32_to_cpu(((struct ext4_dir_entry_2 *)dir_buf)->inode); offset = ctx->pos;