From patchwork Mon Apr 25 00:18:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Katiyar X-Patchwork-Id: 92686 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 94770B6F16 for ; Mon, 25 Apr 2011 10:18:24 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757852Ab1DYASX (ORCPT ); Sun, 24 Apr 2011 20:18:23 -0400 Received: from mail-qy0-f174.google.com ([209.85.216.174]:46898 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757834Ab1DYASW (ORCPT ); Sun, 24 Apr 2011 20:18:22 -0400 Received: by qyk7 with SMTP id 7so507212qyk.19 for ; Sun, 24 Apr 2011 17:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to:cc :content-type; bh=QcuB8lrM9W9iQ86q/dKFX4T2wEj9waX25dVVmJa7CRU=; b=s2RLKqXP67xIvs2XlVMnSZ8aXdLuNtlQrMM4/lmmaAof1DGf5KofxwDFiSfNDJE149 YcROT5x7mFhoynvMzp1soxd1eGlFiq904d8jtAoqdWWifc4IkPajq982fSopoaJWnW5B ho1gju7bn75re6kRusT0+1BoEYLRShwFm1Rk8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=kqL5CYbPwqdvjoUG+83epbPpTb9bXsg0jGHpVM3u146czPMOxZwUVC3Ey/wrisC6EK PyjrZ/d8Zl78JVbdZm1DdgGHrAjF024wVTpLk2s57Dki9faLBdY64BUP1UVPqmsrLGQV Q3rTjchH3AsPbFQYT9Qzk+GoFs7q3f5TIBJg8= Received: by 10.229.45.203 with SMTP id g11mr2417987qcf.65.1303690702170; Sun, 24 Apr 2011 17:18:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.216.70 with HTTP; Sun, 24 Apr 2011 17:18:02 -0700 (PDT) From: Manish Katiyar Date: Sun, 24 Apr 2011 17:18:02 -0700 Message-ID: Subject: [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path. To: ext4 Cc: Manish Katiyar , "Theodore Ts'o" , Jan Kara Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This patch fixes the following. a) Incase journal transaction allocation fails due to ENOMEM don't call ext4_std_error() since it will remount the fs as readonly and logs the message in kernel log. b) Call posix_acl_release() incase journal allocation fails in case of error paths. Signed-off-by: Manish Katiyar --- fs/ext4/acl.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c index 21eacd7..0c98710 100644 --- a/fs/ext4/acl.c +++ b/fs/ext4/acl.c @@ -354,7 +354,6 @@ ext4_acl_chmod(struct inode *inode) EXT4_DATA_TRANS_BLOCKS(inode->i_sb)); if (IS_ERR(handle)) { error = PTR_ERR(handle); - ext4_std_error(inode->i_sb, error); goto out; } error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, clone); @@ -450,8 +449,10 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, retry: handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb)); - if (IS_ERR(handle)) - return PTR_ERR(handle); + if (IS_ERR(handle)) { + error = PTR_ERR(handle); + goto release_and_out; + } error = ext4_set_acl(handle, inode, type, acl); ext4_journal_stop(handle);