From patchwork Mon Dec 10 15:02:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 204934 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 D72352C023D for ; Tue, 11 Dec 2012 02:02:41 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754317Ab2LJPCe (ORCPT ); Mon, 10 Dec 2012 10:02:34 -0500 Received: from li9-11.members.linode.com ([67.18.176.11]:37739 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754300Ab2LJPCc (ORCPT ); Mon, 10 Dec 2012 10:02:32 -0500 Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.72) (envelope-from ) id 1Ti4s7-0001jq-Hh; Mon, 10 Dec 2012 15:02:19 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id 5281724193E; Mon, 10 Dec 2012 10:02:28 -0500 (EST) Date: Mon, 10 Dec 2012 10:02:28 -0500 From: Theodore Ts'o To: Tao Ma Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH V7 00/23] ext4: Add inline data support Message-ID: <20121210150228.GA28666@thunk.org> References: <1351047002-4723-1-git-send-email-tm@tao.ma> <20121206173022.GE30273@thunk.org> <50C147A0.4070109@tao.ma> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <50C147A0.4070109@tao.ma> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Dec 07, 2012 at 09:34:24AM +0800, Tao Ma wrote: > I think ext4_inode->xattr_sem should protect us? When we do xattr > corresponding operation, we just do > down_write/read(&EXT4_I(inode)->xattr_sem), so we should be fine with > this type of operation. Am I missing something here? We're not taking the xattr_sem in ext4_find_inline_data() before we call ext4_xattr_ibody_find(). So I think we need something like this: - Ted --- 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 6b600b4..e96268d 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -143,7 +143,9 @@ int ext4_find_inline_data(struct inode *inode) if (error) return error; + down_read(&EXT4_I(inode)->xattr_sem); error = ext4_xattr_ibody_find(inode, &i, &is); + up_read(&EXT4_I(inode)->xattr_sem); if (error) goto out;