From patchwork Sun Jan 13 10:44:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 211608 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 2B6372C0107 for ; Sun, 13 Jan 2013 21:45:53 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754555Ab3AMKpr (ORCPT ); Sun, 13 Jan 2013 05:45:47 -0500 Received: from mail-da0-f54.google.com ([209.85.210.54]:42469 "EHLO mail-da0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754807Ab3AMKpK (ORCPT ); Sun, 13 Jan 2013 05:45:10 -0500 Received: by mail-da0-f54.google.com with SMTP id n2so1392643dad.13 for ; Sun, 13 Jan 2013 02:45:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=X5+pwBfiKCNmxgu9rJ5BDDOTa6qXoC634xkcj1bRlYo=; b=znffRcWhco6oCnPlZJhI2MawewniIkFnGpWzc922LxyjLLGxts9mRCH36Awuf5uVw0 s2pXJTPjp+gLoDx08Sv+ODGbP5eiRB2Ab26CErjEy3001vGC+ni5Aa9OLdhpEkoMrYXL btvju6CplA3m6Wu31wMbFqBQcK2ksq0esBaNLZYWvLkgm1Wbzq3IlBJCtpRHya56gxDG F1qvNcoNomHbg55eM2HKsoIRIFbOrxcQN8Eegm3yZ0CQMrBNyBjYopyq4KfovMsdRE0W Vx8maX94/nMMVMl0z36yZQAmcBytRhTnV4pBy36EQV832P2xshMc2W7LoAOHsrNsyaU7 agzQ== X-Received: by 10.68.241.103 with SMTP id wh7mr245985018pbc.153.1358073910332; Sun, 13 Jan 2013 02:45:10 -0800 (PST) Received: from localhost.localdomain ([112.23.171.171]) by mx.google.com with ESMTPS id qw8sm6161646pbc.39.2013.01.13.02.45.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 13 Jan 2013 02:45:09 -0800 (PST) From: Wang shilong To: jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Wang shilong , Wang Shilong Subject: [PATCH V1 1/2] Ext2: return ENOMEM rather than EIO if sb_getblk fails Date: Sun, 13 Jan 2013 18:44:06 +0800 Message-Id: <1358073846-1662-1-git-send-email-wangshilong1991@gmail.com> X-Mailer: git-send-email 1.7.11.7 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Wang Shilong As the only reason that sb_getblk fails is that allocation fails. It will be better to use ENOMEM rather than EIO. Signed-off-by: Wang Shilong --- fs/ext2/super.c | 2 +- fs/ext2/xattr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 663fdcd..3308a55 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -1457,7 +1457,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type, else bh = sb_getblk(sb, tmp_bh.b_blocknr); if (unlikely(!bh)) { - err = -EIO; + err = -ENOMEM; goto out; } lock_buffer(bh); diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 06209ec..2d7557d 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -665,7 +665,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh, if (unlikely(!new_bh)) { ext2_free_blocks(inode, block, 1); mark_inode_dirty(inode); - error = -EIO; + error = -ENOMEM; goto cleanup; } lock_buffer(new_bh);