From patchwork Wed Jul 27 09:50:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1011072 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6R9qhRN001930 for ; Wed, 27 Jul 2011 09:52:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752922Ab1G0Jwe (ORCPT ); Wed, 27 Jul 2011 05:52:34 -0400 Received: from mail-pz0-f42.google.com ([209.85.210.42]:52123 "EHLO mail-pz0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955Ab1G0Jwc (ORCPT ); Wed, 27 Jul 2011 05:52:32 -0400 Received: by pzk37 with SMTP id 37so2440428pzk.1 for ; Wed, 27 Jul 2011 02:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=l48agDkA5qdKWqgeV1dItzkLWs8FyjJtZvltnyFyQto=; b=FWAc2qGnDz0O7T7V4REu5CftMcqLWrEvAyUdY84Wx5LxcYtRKdSMiX2Vn6pEInG7y+ O3oWe98kxzA7O0pHyrg+vvpwEZNVrNRhbeHYk7OVf8Rl1MPavF/P2fgdtv0L1hWZRLYm hBwDZbZ6goa3Putag61VyWNrAhRjRee9XEM00= Received: by 10.68.8.34 with SMTP id o2mr9141859pba.199.1311760351415; Wed, 27 Jul 2011 02:52:31 -0700 (PDT) Received: from shale.localdomain ([41.139.221.94]) by mx.google.com with ESMTPS id r8sm1511704pbd.92.2011.07.27.02.52.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jul 2011 02:52:30 -0700 (PDT) Date: Wed, 27 Jul 2011 12:50:33 +0300 From: Dan Carpenter To: Josef Bacik Cc: Chris Mason , "open list:BTRFS FILE SYSTEM" , kernel-janitors@vger.kernel.org Subject: [patch] btrfs: unlock on error in btrfs_file_llseek() Message-ID: <20110727095033.GI3824@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 27 Jul 2011 09:52:43 +0000 (UTC) There were some unlocks on error missing in a recent patch to btrfs_file_llseek(). Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" 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/btrfs/file.c b/fs/btrfs/file.c index 59cbdb1..94d8342 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1804,10 +1804,14 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin) } } - if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) - return -EINVAL; - if (offset > inode->i_sb->s_maxbytes) - return -EINVAL; + if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) { + ret = -EINVAL; + goto out; + } + if (offset > inode->i_sb->s_maxbytes) { + ret = -EINVAL; + goto out; + } /* Special lock needed here? */ if (offset != file->f_pos) {