From owner-svn-src-all@freebsd.org Thu Jan 14 21:33:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C17EA83106 for ; Thu, 14 Jan 2016 21:33:26 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45B0E1CA7 for ; Thu, 14 Jan 2016 21:33:26 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x232.google.com with SMTP id u188so365889816wmu.1 for ; Thu, 14 Jan 2016 13:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=YC+gxE5xgepN9E5R0aDLJUWojavIx2C9bf6tcLBJjdA=; b=mjRjlaEpRcNoG6SOyK5UEntx9b/2QBw5zyTnzyRa/AzqLV7ooA/vsjeW7JWV0ThgIY C0cDOT+fRlifva64j24dwP6Gsg10EN64fdANEOYj4dqhbw0cVn/ZGUjBrulgoUNJPDXo MxjiMlczpRT1cmDq8Y9sEeGBcSbu8GGPJpQuoWMcS86NotEfNcxlBWL0gLvI3QUqJfQW AFfWlzbPJtURR14vjEehdrcQ+piaBYPhbhMRDz3UBxUy+TnQWwOhB9AEqfewu8LNln2w 925v45zRH/o6/LWR7NGUF57e8S/1kJSsUn2NTQk5Mstlvv/8nSVCN3r/VZfvyNf6pycG 0MQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=YC+gxE5xgepN9E5R0aDLJUWojavIx2C9bf6tcLBJjdA=; b=fZKudpEuexRdojPSYb4J80GYQAGD6+H8vLYN93Bd+DlU2H/7SEVwj+dc9bi+79ZLx+ wpWmUUVZfUOcfPrS04DoO8F8jDfRFXB+I8C8KHFX+ug9cT8agGVJzC734JRdeB4qvY6o Z0WGr2ccToE02lBUSEN70qQ47DNmAU1hIDg7rLnXU6xbJqi/Esi+eYivIeRy5MizSJgU URGvvYo2YlXip6LOVqWJrrcHVaHs2mzX0SSIvnyP+hsCHDK3d6ZMUNDxFgLUuem7jqBU kUm+plMWYs8tx63i1LbZ4g6ziI1JGWr/+ksHoouTzEMr+XJCWdc5CgDZb75c51WRRPm1 uGJw== X-Gm-Message-State: ALoCoQkqsWgK871oPp5m9S415dj/1IKpgSRmCiZrLMHm0DbjUPk1M05SoCtrTKcSTuj0d5kMS+KXkGFNZ/QZaJY7qZ/7DsbIhg== X-Received: by 10.28.68.68 with SMTP id r65mr7464869wma.95.1452807204762; Thu, 14 Jan 2016 13:33:24 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id v191sm8947334wme.1.2016.01.14.13.33.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 13:33:23 -0800 (PST) Subject: Re: svn commit: r294040 - head/sys/boot/zfs To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601142131.u0ELVQ70054944@repo.freebsd.org> From: Steven Hartland Message-ID: <56981437.2050301@multiplay.co.uk> Date: Thu, 14 Jan 2016 21:33:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601142131.u0ELVQ70054944@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 21:33:26 -0000 Fat fingers submitted before adding headers: MFC after: 2 weeks X-MFC-With: r293268 On 14/01/2016 21:31, Steven Hartland wrote: > Author: smh > Date: Thu Jan 14 21:31:26 2016 > New Revision: 294040 > URL: https://svnweb.freebsd.org/changeset/base/294040 > > Log: > Prevent bogus compiler in ZFS boot code > > Silence a bogus compiler warning about indexing past the end of dn_bonus. > > The ZFS code ensures this is not possible but the compiler can't determine > this so added an additional check to prevent this warning. > > Sponsored by: Multiplay > > Modified: > head/sys/boot/zfs/zfsimpl.c > > Modified: head/sys/boot/zfs/zfsimpl.c > ============================================================================== > --- head/sys/boot/zfs/zfsimpl.c Thu Jan 14 21:29:38 2016 (r294039) > +++ head/sys/boot/zfs/zfsimpl.c Thu Jan 14 21:31:26 2016 (r294040) > @@ -2165,7 +2165,13 @@ zfs_lookup(const struct zfsmount *mount, > strcpy(&path[sb.st_size], p); > else > path[sb.st_size] = 0; > - if (sb.st_size + sizeof(znode_phys_t) <= dn.dn_bonuslen) { > + /* > + * Second test is purely to silence bogus compiler > + * warning about accessing past the end of dn_bonus. > + */ > + if (sb.st_size + sizeof(znode_phys_t) <= > + dn.dn_bonuslen && sizeof(znode_phys_t) <= > + sizeof(dn.dn_bonus)) { > memcpy(path, &dn.dn_bonus[sizeof(znode_phys_t)], > sb.st_size); > } else { >