From owner-svn-src-head@freebsd.org Tue Sep 3 14:07:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E81BCDD1CF; Tue, 3 Sep 2019 14:06:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N8003yMnz4Q44; Tue, 3 Sep 2019 14:06:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 4D3041ADD0; Tue, 3 Sep 2019 14:06:22 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6B9821A35B; Tue, 16 Apr 2019 11:37:20 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 239AA88829; Tue, 16 Apr 2019 11:37:20 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 121C41A35A; Tue, 16 Apr 2019 11:37:20 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C2D421A355 for ; Tue, 16 Apr 2019 11:37:16 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8529A88825; Tue, 16 Apr 2019 11:37:16 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E9931F09D; Tue, 16 Apr 2019 11:37:16 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GBbGpc046583; Tue, 16 Apr 2019 11:37:16 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GBbG0m046582; Tue, 16 Apr 2019 11:37:16 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201904161137.x3GBbG0m046582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346269 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 346269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 239AA88829 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:07:00 -0000 X-Original-Date: Tue, 16 Apr 2019 11:37:16 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:07:00 -0000 Author: fsu Date: Tue Apr 16 11:37:15 2019 New Revision: 346269 URL: https://svnweb.freebsd.org/changeset/base/346269 Log: ext2fs: Initial version of DTrace support. Commit forgotten file. Reviewed by: pfg, gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19848 Modified: head/sys/fs/ext2fs/ext2_extents.c Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Tue Apr 16 11:30:41 2019 (r346268) +++ head/sys/fs/ext2fs/ext2_extents.c Tue Apr 16 11:37:15 2019 (r346269) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -46,9 +47,17 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, extents, "int", "char*"); + static MALLOC_DEFINE(M_EXT2EXTENTS, "ext2_extents", "EXT2 extents"); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS static void ext4_ext_print_extent(struct ext4_extent *ep) { @@ -230,22 +239,22 @@ ext4_ext_check_header(struct inode *ip, struct ext4_ex fs = ip->i_e2fs; if (eh->eh_magic != EXT4_EXT_MAGIC) { - error_msg = "invalid magic"; + error_msg = "header: invalid magic"; goto corrupted; } if (eh->eh_max == 0) { - error_msg = "invalid eh_max"; + error_msg = "header: invalid eh_max"; goto corrupted; } if (eh->eh_ecount > eh->eh_max) { - error_msg = "invalid eh_entries"; + error_msg = "header: invalid eh_entries"; goto corrupted; } return (0); corrupted: - ext2_fserr(fs, ip->i_uid, error_msg); + SDT_PROBE2(ext2fs, , trace, extents, 1, error_msg); return (EIO); } @@ -412,7 +421,7 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block, ppos++; if (ppos > depth) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "ppos > depth => extent corrupted"); error = EIO; brelse(bp); @@ -643,13 +652,13 @@ ext4_ext_insert_index(struct inode *ip, struct ext4_ex fs = ip->i_e2fs; if (lblk == path->ep_index->ei_blk) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "lblk == index blk => extent corrupted"); return (EIO); } if (path->ep_header->eh_ecount >= path->ep_header->eh_max) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "ecout > maxcount => extent corrupted"); return (EIO); } @@ -667,7 +676,7 @@ ext4_ext_insert_index(struct inode *ip, struct ext4_ex memmove(idx + 1, idx, len * sizeof(struct ext4_extent_index)); if (idx > EXT_MAX_INDEX(path->ep_header)) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "index is out of range => extent corrupted"); return (EIO); } @@ -736,7 +745,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa * We will split at current extent for now. */ if (path[depth].ep_ext > EXT_MAX_EXTENT(path[depth].ep_header)) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "extent is out of range => extent corrupted"); return (EIO); } @@ -773,7 +782,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa ex = EXT_FIRST_EXTENT(neh); if (path[depth].ep_header->eh_ecount != path[depth].ep_header->eh_max) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "extents count out of range => extent corrupted"); error = EIO; goto cleanup; @@ -1362,7 +1371,7 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ eh = path[depth].ep_header; if (!eh) { - ext2_fserr(ip->i_e2fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "bad header => extent corrupted"); return (EIO); } @@ -1449,7 +1458,8 @@ ext4_read_extent_tree_block(struct inode *ip, e4fs_dad eh = ext4_ext_block_header(bp->b_data); if (eh->eh_depth != depth) { - ext2_fserr(fs, ip->i_uid, "unexpected eh_depth"); + SDT_PROBE2(ext2fs, , trace, extents, 1, + "unexpected eh_depth"); goto err; }