From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dr. David Alan Gilbert" Subject: hpfs_setattr error case avoids unlock_kernel ? Date: Sun, 12 Dec 2010 00:49:47 +0000 Message-ID: <20101212004947.GA9138@gallifrey> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: mikulas@artax.karlin.mff.cuni.cz, hch@lst.de Return-path: Received: from mx.treblig.org ([80.68.94.177]:50392 "EHLO mx.treblig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318Ab0LLBZY (ORCPT ); Sat, 11 Dec 2010 20:25:24 -0500 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, 'sparse' pointed out to me the code in fs/hpfs/inode.c:hpfs_setattr changed by Christoph's patch 1025774ce411f2bd4b059ad7b53f0003569b74fa 'remove inode_setattr', and it does look like the error path avoids an unlock_kernel (around like 284 of fs/hpfs/inode.c) fs/hpfs/inode.c:265:5: warning: context imbalance in 'hpfs_setattr' - different lock contexts for basic block -------------------------- error = inode_change_ok(inode, attr); if (error) goto out_unlock; if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size != i_size_read(inode)) { error = vmtruncate(inode, attr->ia_size); if (error) ************ return error; } setattr_copy(inode, attr); mark_inode_dirty(inode); hpfs_write_inode(inode); out_unlock: unlock_kernel(); return error; -------------------------- it looks like that 1st 'return error' needs to change into a goto out_unlock; Dave -- -----Open up your eyes, open up your mind, open up your code ------- / Dr. David Alan Gilbert | Running GNU/Linux | Happy \ \ gro.gilbert @ treblig.org | | In Hex / \ _________________________|_____ http://www.treblig.org |_______/