From patchwork Sun May 26 13:19:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: boxi liu X-Patchwork-Id: 246394 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 400B02C013D for ; Sun, 26 May 2013 23:19:17 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752864Ab3EZNTQ (ORCPT ); Sun, 26 May 2013 09:19:16 -0400 Received: from mail-ie0-f180.google.com ([209.85.223.180]:47459 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496Ab3EZNTQ (ORCPT ); Sun, 26 May 2013 09:19:16 -0400 Received: by mail-ie0-f180.google.com with SMTP id b11so2088200iee.25 for ; Sun, 26 May 2013 06:19:15 -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:cc:content-type; bh=g3toZsX6lTY5mfdgMc/+6Wiy1yYOa3xVOmA3D8I5Qeg=; b=ZaLyEr5RFoHoZBSG7JOCT05bwnvPMBYaUh7H/yZ26N9oPStHdNSuK0HuSCuy69UAZC 4Umlzd4SaEWfgPqsLChyVUtj7sY8lT+X7qavT6DYGrV9EUe8jYhd2cr+E4f7xdcl29iN GDpQsXqJSsvH4TmnqN5pwzMVb2AvTa3P9p6RpWw9xU9zSeVGIYpaRIkxsNh07A0Jm67M UozjqFcyBCsc9Dxld77/kAfFAGSFIvZgwDkBmv1S/a0rSkx8mtA25TaRidaEXPmb0BbP pPd7STy3nGk1J7YrXGh+Hjvd6NdkRCKxNk/yQjOp3qxJIjYVgo3V0f/L2qr230xWreom TFrQ== MIME-Version: 1.0 X-Received: by 10.42.11.74 with SMTP id t10mr15942977ict.49.1369574355829; Sun, 26 May 2013 06:19:15 -0700 (PDT) Received: by 10.64.167.233 with HTTP; Sun, 26 May 2013 06:19:15 -0700 (PDT) Date: Sun, 26 May 2013 21:19:15 +0800 Message-ID: Subject: [PATCH] ext4:an improvement in ext4 feature inline_data From: boxi liu To: Theodore Tso Cc: Robin Dong , "linux-ext4@vger.kernel.org" , "tm@tao.ma" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org In ext4 feature inline_data,it use the xattr's space to store the inline data in inode.When we calculate the inline data as the xattr,we add the pad.But in get_max_inline_xattr_value_size() function we count the free space without pad.It cause some contents are moved to a block even if it can be stored in the inode. Signed-off-by:liulei Reviewed-by: Tao Ma --- fs/ext4/inline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- -- 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 c0fd1a1..87758ca 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -71,7 +71,7 @@ static int get_max_inline_xattr_value_size(struct inode *inode, entry = (struct ext4_xattr_entry *) ((void *)raw_inode + EXT4_I(inode)->i_inline_off); - free += le32_to_cpu(entry->e_value_size); + free += EXT4_XATTR_SIZE(le32_to_cpu(entry->e_value_size)); goto out; }