From owner-svn-src-head@FreeBSD.ORG Fri Jun 3 06:58:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A07181065670; Fri, 3 Jun 2011 06:58:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916A58FC1C; Fri, 3 Jun 2011 06:58:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p536wOCY052440; Fri, 3 Jun 2011 06:58:24 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p536wOuI052438; Fri, 3 Jun 2011 06:58:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106030658.p536wOuI052438@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 3 Jun 2011 06:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222642 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2011 06:58:24 -0000 Author: ae Date: Fri Jun 3 06:58:24 2011 New Revision: 222642 URL: http://svn.freebsd.org/changeset/base/222642 Log: Add diagnostic message about not aligned partitions. Idea from: ivoras Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Jun 3 06:34:29 2011 (r222641) +++ head/sys/geom/part/g_part.c Fri Jun 3 06:58:24 2011 (r222642) @@ -248,6 +248,7 @@ g_part_check_integrity(struct g_part_tab { struct g_part_entry *e1, *e2; struct g_provider *pp; + off_t offset; int failed; failed = 0; @@ -294,6 +295,16 @@ g_part_check_integrity(struct g_part_tab (intmax_t)table->gpt_last); failed++; } + if (pp->stripesize > 0) { + offset = e1->gpe_start * pp->sectorsize; + if (e1->gpe_offset > offset) + offset = e1->gpe_offset; + if ((offset + pp->stripeoffset) % pp->stripesize) { + DPRINTF("partition %d is not aligned on %u " + "bytes\n", e1->gpe_index, pp->stripesize); + /* Don't treat this as a critical failure */ + } + } e2 = e1; while ((e2 = LIST_NEXT(e2, gpe_entry)) != NULL) { if (e2->gpe_deleted || e2->gpe_internal) @@ -723,7 +734,11 @@ g_part_ctl_add(struct gctl_req *req, str if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { sb = sbuf_new_auto(); G_PART_FULLNAME(table, entry, sb, gp->name); - sbuf_cat(sb, " added\n"); + if (pp->stripesize > 0 && entry->gpe_pp->stripeoffset != 0) + sbuf_printf(sb, " added, but partition is not " + "aligned on %u bytes\n", pp->stripesize); + else + sbuf_cat(sb, " added\n"); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb);