Skip to content

Instantly share code, notes, and snippets.

View nedbass's full-sized avatar

Ned Bass nedbass

  • LLNL
  • Livermore, CA
View GitHub Profile
@nedbass
nedbass / gist:4235942
Created December 7, 2012 19:46
Failed spl-dkms build
root@ubuntu:/# apt-get install ubuntu-zfs
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
binutils cpp cpp-4.6 dkms fakeroot gcc gcc-4.6 libc-dev-bin libc6-dev
libgmp10 libgomp1 libmpc2 libmpfr4 libnvpair1 libquadmath0 libuutil1 libzfs1
libzpool1 linux-libc-dev make manpages manpages-dev patch spl spl-dkms
zfs-dkms zfsutils
Suggested packages:
@nedbass
nedbass / gist:4638150
Created January 25, 2013 21:42
Related to openzfs/zfs#1240 - create a file that triggered the panic - reboot - mount filesystem - rm /path/to/file[TAB] hitting TAB for bash autocomplete hit the SPL panic below
ZFS: Invalid mode: 0x2d
VERIFY(0) failed
SPLError: 3430:0:(zfs_znode.c:339:zfs_inode_set_ops()) SPL PANIC
SPL: Showing stack for process 3430
Pid: 3430, comm: bash Tainted: P --------------- 2.6.32-279.9.1.1chaos.ch5.1.x86_64 #1
Call Trace:
[<ffffffffa04a85a7>] ? spl_debug_dumpstack+0x27/0x40 [spl]
[<ffffffffa04a9d51>] ? spl_debug_bug+0x81/0xd0 [spl]
[<ffffffffa074b294>] ? zfs_znode_alloc+0x334/0x540 [zfs]
[<ffffffffa06c2c24>] ? dmu_object_info_from_dnode+0x144/0x1b0 [zfs]
@nedbass
nedbass / llapi_layout_test.c
Last active December 12, 2015 07:19
Test suite for llapi_layout interface.
/*
* These tests exercise the llapi_layout API which abstracts the layout
* of a Lustre file behind an opaque data type. They assume a Lustre file
* system with at least 6 OSTs and a pool names "testpool" containing 6
* OSTs. For example,
*
* sudo lctl pool_new lustre.testpool
* sudo lctl pool_add lustre.testpool OST[0-5]
* gcc -D LUSTRE_DIR=\"/mnt/lustre/somedir\" -Wall -g -Werror -o test test.c \
* -llustrepapi
@nedbass
nedbass / snapsend
Last active December 12, 2018 23:56
Hacked-up backup script using ZFS snapshots. Designed to 'zfs send' streams to disk rather than sending them to a remote pool. This lets me send them to a cloud storage provider like Ubuntu One or Dropbox.
#!/usr/bin/perl -w
use strict;
use Getopt::Std;
use File::Basename;
use POSIX qw(strftime);
my $fulls = 3;
my $incrementals = 30;
[18453.293016] [<ffffffff811bc0ed>] do_sys_poll+0x4ad/0x560
[18453.293016] [<ffffffff8119d9d3>] ? __mem_cgroup_commit_charge+0xa3/0x360
[18453.293016] [<ffffffff8119d9d3>] ? __mem_cgroup_commit_charge+0xa3/0x360
[18453.293016] [<ffffffff811babe0>] ? poll_select_copy_remaining+0x130/0x130
[18453.293016] [<ffffffff81170e46>] ? page_add_new_anon_rmap+0xc6/0x1d0
[18453.293016] [<ffffffff8109d325>] ? select_task_rq_fair+0x505/0x680
[18453.293016] [<ffffffff81165a18>] ? handle_pte_fault+0x488/0xa70
[18453.293016] [<ffffffff8104c11f>] ? kvm_clock_read+0x1f/0x30
[18453.293016] [<ffffffff81019f29>] ? sched_clock+0x9/0x10
[18453.293016] [<ffffffff8109ac8d>] ? sched_clock_local+0x1d/0x80
PID: 0 TASK: ffffffff81c13460 CPU: 0 COMMAND: "swapper/0"
(active)
PID: 0 TASK: ffff880119afca40 CPU: 1 COMMAND: "swapper/1"
#0 [ffff880119b09e60] schedule at ffffffff816672f0
PID: 1 TASK: ffff880119a76b40 CPU: 1 COMMAND: "systemd"
#0 [ffff880119ae1d68] schedule at ffffffff816672f0
#1 [ffff880119ae1de0] schedule_hrtimeout_range_clock at ffffffff8166676d
#2 [ffff880119ae1e78] schedule_hrtimeout_range at ffffffff816667a3
------------------- /proc/spl/kstat
------------------- /proc/spl/kstat/zfs
------------------- /proc/spl/kstat/zfs/tank
------------------- /proc/spl/kstat/zfs/tank/io
23 3 0x00 1 80 66683642782372 86956861243016
nread nwritten reads writes wtime wlentime wupdate rtime rlentime rupdate wcnt rcnt
7957733376 15228314624 802482 413892 388274670018 527550526511030 86299075894338 569817761441 527550526511030 86299075916697 0 0
------------------- /proc/spl/kstat/zfs/tank/dmu_tx_assign
22 1 0x01 32 1536 66683642779563 86956863577835
name type data
struct zio {
io_bookmark = {
zb_objset = 40,
zb_object = 5189,
zb_level = 0,
zb_blkid = 1,
zb_func = 0xffffffffa04ca840 "dbuf_write"
},
io_prop = {
zp_checksum = ZIO_CHECKSUM_INHERIT,
@nedbass
nedbass / gist:f5eb28da0f0886dffa55
Created July 9, 2014 19:06
llapi: get OST count from /proc
commit 6df9cc253cbcde4a912dd42f106015fdd74ca695
Author: Ned Bass <bass6@llnl.gov>
Date: Wed Nov 6 11:17:12 2013 -0800
LLNL-0000 llapi: get OST count from proc
Add a fallback method to llapi_get_obd_count() for getting the number
of OSTs in the filesystem. If the ioctl() method fails, try to count
the OSTs by examining the target_obd file under /proc. This method
requires inferring the Lustre filesystem name by comparing the
4054] [<ffffffffa04af27e>] ? taskq_thread+0x12f/0x3e6 [spl]
[ 7036.284054] [<ffffffff8104a4ce>] ? default_wake_function+0x0/0x9
[ 7036.284054] [<ffffffffa04af14f>] ? taskq_thread+0x0/0x3e6 [spl]
[ 7036.284054] [<ffffffff81065009>] ? kthread+0x79/0x81
[ 7036.284054] [<ffffffff81011baa>] ? child_rip+0xa/0x20
[ 7036.284054] [<ffffffff81064f90>] ? kthread+0x0/0x81
[ 7036.284054] [<ffffffff81011ba0>] ? child_rip+0x0/0x20
[ 7036.284054] zvol/9 S ffff88003784c988 0 28380 2 0x00000000
[ 7036.284054] ffff88007fb554c0 0000000000000046 ffff88007d2fcde8 ffffffff8103fc9e
[ 7036.284054] ffff8800018157c0 ffff880001915828 000000000000f9e0 ffff88007eae5fd8