回复:linux-nvdimm@lists.01.org
by 吴先生
---- 原邮件信息 -----
发件人:cpqtsmb@nsuk.org
收件人:linux-nvdimm@lists.01.org;
发送时间:2018-6-19 7:45:24
主题: 敏捷软件开发(Agile Software Development ) 内*容 *请 *附-件-查-阅 959717
2 years, 8 months
[PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes()
by Dan Williams
Commit 60622d68227d "x86/asm/memcpy_mcsafe: Return bytes remaining"
converted callers of memcpy_mcsafe() to expect a positive 'bytes
remaining' value rather than a negative error code. The nsio_rw_bytes()
conversion failed to return success. The failure is benign in that
nsio_rw_bytes() will end up writing back what it just read.
Fixes: 60622d68227d ("x86/asm/memcpy_mcsafe: Return bytes remaining")
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: Vishal Verma <vishal.l.verma(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/nvdimm/claim.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 2e96b34bc936..fb667bf469c7 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -278,6 +278,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
return -EIO;
if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0)
return -EIO;
+ return 0;
}
if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {
2 years, 8 months
回复:最近这些课程挺火的 HR ·吴树霞推荐
by fg
7月公开课推荐
课程顾问:颜小姐 13544013315(同微信) QQ:1917121319 公开课与企业定制内训业务欢迎来电咨询(咨询有礼)
分类序号课程Chinese Name价格天数讲师时间地点
人力资源1人力资源总监实战训练班--打赢六大战役---成为互联网时代最专业的人力资源总监5200元2欧阳少波7月12-13日深圳
2TTT初、中、高升级版“猫计划”系列版权课程10980元7讲师团7月12-13日深圳
3TTT中级豹班-课程教学与设计(版权课程)3800元2詹锦亚7月12-13日深圳
4高级秘书、助理和行政人员技能提高训练营3800元2敦平7月13-14日深圳
5行政管理实操训练4600元2欧阳少波7月14-15日深圳
6公文写作与档案管理(企业文档一体化) 3980元2汪廷云7月20-21日广州
7新《劳动合同法》、《社会保险法》、《工伤保险条例》实操应对策略与有效调岗调薪、裁员解雇及违纪问题员工处理技巧 (B单元)3200元2钟永棣7月20-21日深圳
8企业绩效考核与薪酬体系设计实战特训班6800元3蔡 巍7月20-22日广州
9HRBP实操班—人力资源如何成为企业战略性业务伙伴4200元2王海波7月21-22日深圳
10金牌面试官-高效招聘与精准面试法3200元2丁 坚7月25-26日深圳
国际贸易11离岸架构暨国际贸易之离岸金融税务筹划3200元2陈硕7月28-29日深圳
工厂管理12采购流程优化及供应商评估与管理3800元2天张仲豪7月06-07日广州
13现场管理与改善实战训练 3980元2秘祖利7月13-14日广州
14高效仓储管理与工厂物料配送 3800元2张仲豪7月13-14日深圳
15产品结构设计3600元2李老师7月13-14日深圳
16TPM全面生产管理与项目推进3200元2罗庆伟7月14-15日广州
17塑胶(料)件设计与注塑3600元2李老师7月20-21日广州
18精准供应链管理训练营 3980元2顾闻知7月20-21日深圳
19注塑零缺陷及模具维修技术3800元2杨建宏7月20-21日深圳
20TQM全面质量管理持续改善实战训练Hot!3680元2韩老师7月21-22日广州
21《GD&T形位公差与尺寸链计算》
即《GD&T几何尺寸与公差》3600元2李老师7月27-28日广州
22采购战略、运营与风险管理4300元2柳老师7月27-28日深圳
23TPM-全员维护设备管理3980元2王国超 7月27-28日深圳
24生产计划与物料控制PMC实务4200元2雷卫旭7月28-29日深圳
25标准工时与生产线平衡管理 3200元2陈志华7月28-29日深圳
26TPS精益精髓与项目推进3200元2罗庆伟7月28-29上海日上海
27塑胶产品设计3600元2李老师7月6-7日广州
研发管理系列28成功的产品经理——产品经理的野蛮成长2800元2Charles/ Jay7月23-24日深圳
29从技术走向管理——研发经理的领导力与执行力 2800元2Giles7月23-24日深圳
30研发人员的考核与激励2800元2Jay7月26-27日深圳
31产品测试管理2800元2James7月26-27日深圳
综合管理 32新任经理、部门经理全面管理技能提升训练3400元2曹礼明7月07-08日深圳
33全能型车间主任实战技能训练3200元2陈志华7月07-08日深圳
34中高层经理全面管理技能实战训练5200元3李革增7月12-14日深圳
35《九段经理人®》沙盘版权课程4600元2廖斌7月13-14日深圳
36中层经理团队管理进化之领导、协作与执行4980元3冉云帆7月13-15日深圳
37赢在中层执行力3200元2纪鉴7月14-15日深圳
38世界咖啡:卓有成效的管理者 2800元2 周希奇7月20-21日广州
39TWI一线主管技能训练(版权课)3980元2周得良7月20-21日深圳
40中高层管理者管理效能提升六部曲3980元2黄红发7月27-28日广州
41优秀班组长管理技能提升高级研修班3200元2周广锋7月27-28日广州
42游戏式积分管理模式 New! 4680元2谭文平7月30-31日深圳
职场技能43企业白领办公技能(PPT+Excel综合课程2天精华版)2017版3200元2陶源7月20-21日深圳
营销实战管理系列44销售精英2天强化训练2018版2800元2王 越7月07-08上海日上海
45优质客户服务与客户投诉、抱怨处理技巧提升3800元2敦平7月11-12日深圳
46我赢为王——冠军销售心态课3200元2纪鉴7月12-13日深圳
47狼性销售团队的建设与管理4280元2李俊7月13-14日广州
48营销管理中的“法”“理”“道”(大客户开发,渠道建设,团队管理)6800元3鲍英凯7月19-21日深圳
49产品需求分析与需求管理2800元2Don7月26-27日深圳
财务管理50内部审计与反舞弊实务3600元2邱健7月20-21日深圳
2 years, 8 months
[RFC] ktest: add pmem support
by Matthew Wilcox
I haven't got a filesystem mounted using DAX yet, but I thought I might
as well send out the current patch against ktest for enabling persistent
memory. It's clearly *wrong*, but I do get a /dev/pmem0 device under
Linux once I add all the right config options. So it's a start, and
people who are deeper into this than I am can suggest things to do to
make it better.
diff --git a/boot.ktest b/boot.ktest
index 8b22e1d..7e7d252 100644
--- a/boot.ktest
+++ b/boot.ktest
@@ -5,6 +5,7 @@ require-lib tests/prelude.sh
config-mem 2G
config-scratch-devs 4G
config-scratch-devs 4G
+config-pmem-devs 4G
config-timeout 600000
main()
diff --git a/lib/libktest.sh b/lib/libktest.sh
index 7843088..ad1ea62 100644
--- a/lib/libktest.sh
+++ b/lib/libktest.sh
@@ -271,7 +271,7 @@ start_vm()
case $ktest_arch in
x86|x86_64)
- qemu_cmd+=(-cpu host -machine accel=kvm)
+ qemu_cmd+=(-cpu host -machine accel=kvm,nvdimm)
;;
mips)
qemu_cmd+=(-cpu 24Kf -machine malta)
@@ -283,7 +283,7 @@ start_vm()
esac
qemu_cmd+=( \
- -m "$ktest_mem" \
+ -m "$ktest_mem,slots=8,maxmem=1T" \
-smp "$ktest_cpus" \
-kernel "$ktest_kernel_binary/vmlinuz" \
-append "$(join_by " " ${kernelargs[@]})" \
@@ -316,6 +316,13 @@ start_vm()
disknr=$((disknr + 1))
}
+ qemu_pmem()
+ {
+ qemu_cmd+=(-object memory-backend-file,id=mem$disknr,share,"$1",align=128M)
+ qemu_cmd+=(-device nvdimm,memdev=mem$disknr,id=nv$disknr,label-size=2M)
+ disknr=$((disknr + 1))
+ }
+
qemu_disk file="$ktest_root_image",snapshot=on
for size in "${ktest_scratch_devs[@]}"; do
@@ -325,6 +332,13 @@ start_vm()
qemu_disk file="$file",cache=unsafe
done
+ for size in "${ktest_pmem_devs[@]}"; do
+ local file="$ktest_tmp/dev-$disknr"
+
+ fallocate -l "$size" "$file"
+ qemu_pmem mem-path="$file",size=$size
+ done
+
set|grep -vE '^[A-Z]' > "$ktest_tmp/env"
set +o errexit
diff --git a/lib/parse-test.sh b/lib/parse-test.sh
index 30b23ad..353d713 100644
--- a/lib/parse-test.sh
+++ b/lib/parse-test.sh
@@ -90,6 +90,11 @@ parse_test_deps()
ktest_scratch_devs+=("$1")
}
+ config-pmem-devs()
+ {
+ ktest_pmem_devs+=("$1")
+ }
+
config-image()
{
ktest_root_image=$1
2 years, 8 months
[ndctl PATCH v2] ndctl, contrib: Add helper scripts for new release
by Vishal Verma
Add a couple of helper scripts to codify the release process.
First is do_abidiff: This builds RPMs for two different versions of
ndctl (specified as a git revision range, for example vXX.Y..HEAD). It
then uses abipkgdiff to determine whether the commits in that range
(collectively) introduced any compatibility breaking ABI changes.
Changing or removing a publicly exported function is considered a
breakage, where as adding new functions is acceptable.
Second is prepare-release.sh: Its primary purpose is to codify the
libtool version update. It does a variety of sanity checks to ensure we
didn't involuntarily bump the soname, or update the libtool version in
an unexpected way.
prepare-release.sh also calls do_abidiff to perform an abi check between
the last bug-fix update and the new version about to be released.
Cc: Dan Williams <dan.j.williams(a)intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
contrib/do_abidiff | 73 ++++++++++++++
contrib/prepare-release.sh | 198 +++++++++++++++++++++++++++++++++++++
2 files changed, 271 insertions(+)
create mode 100755 contrib/do_abidiff
create mode 100755 contrib/prepare-release.sh
diff --git a/contrib/do_abidiff b/contrib/do_abidiff
new file mode 100755
index 0000000..a520c3c
--- /dev/null
+++ b/contrib/do_abidiff
@@ -0,0 +1,73 @@
+#!/bin/bash -e
+
+range="$*"
+old="${range%%..*}"
+new="${range##*..}"
+
+err()
+{
+ echo "$1"
+ exit 1
+}
+
+build_rpm()
+{
+ local cur=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
+ local ref="$1"
+ local version=""
+
+ # prepare ndctl tree
+ rm -rf results_ndctl
+ git checkout -b rel_${ref} $ref
+ ./autogen.sh
+ ./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64
+ make clean
+ make rhel/ndctl.spec
+ cp rhel/ndctl.spec .
+
+ # build and copy RPMs
+ version="$(./git-version)"
+ git archive --format=tar --prefix="ndctl-${version}/" HEAD | gzip > ndctl-${version}.tar.gz
+ fedpkg --release master --module-name ndctl mockbuild
+ mkdir -p release/rel_${ref}/
+ cp results_ndctl/*/*/*.x86_64.rpm release/rel_${ref}/
+
+ # restore ndctl branch and cleanup
+ git checkout $cur
+ git branch -D rel_${ref}
+ rm ndctl-${version}.tar.gz
+ rm ndctl-${version}*.src.rpm
+ rm -rf results_ndctl
+ rm -f ndctl.spec
+}
+
+do_diff()
+{
+ local pkg="$1"
+ local old_base="$(find . -regex "./release/rel_${old}/${pkg}-[0-9]+.*" | head -1)"
+ local new_base="$(find . -regex "./release/rel_${new}/${pkg}-[0-9]+.*" | head -1)"
+ local old_dev="$(find . -regex "./release/rel_${old}/${pkg}-devel-[0-9]+.*" | head -1)"
+ local new_dev="$(find . -regex "./release/rel_${new}/${pkg}-devel-[0-9]+.*" | head -1)"
+ local old_lib="$(find . -regex "./release/rel_${old}/${pkg}-libs-[0-9]+.*" | head -1)"
+ local new_lib="$(find . -regex "./release/rel_${new}/${pkg}-libs-[0-9]+.*" | head -1)"
+
+ [ -n "$pkg" ] || err "specify a package for diff (ndctl, daxctl)"
+
+ abipkgdiff --dso-only --no-added-syms --harmless --drop-private-types \
+ --devel1 "$old_dev" --devel2 "$new_dev" \
+ "$old_base" "$new_base"
+ abipkgdiff --no-added-syms --harmless --drop-private-types \
+ --devel1 "$old_dev" --devel2 "$new_dev" \
+ "$old_lib" "$new_lib"
+}
+
+[ -e "COPYING" ] || err "Run from the top level of an ndctl tree"
+if ! command -v "abipkgdiff" >/dev/null; then
+ err "missing abipkgdiff. Please install libabigail"
+fi
+rm -rf release/rel*
+
+build_rpm $old > release/buildlog_$old 2>&1
+build_rpm $new > release/buildlog_$new 2>&1
+do_diff ndctl
+do_diff daxctl
diff --git a/contrib/prepare-release.sh b/contrib/prepare-release.sh
new file mode 100755
index 0000000..45be4d8
--- /dev/null
+++ b/contrib/prepare-release.sh
@@ -0,0 +1,198 @@
+#!/bin/bash -e
+
+# Arguments:
+# fix - fixup release instead of a full release
+# ignore_rev - ignore the check for _REVISION in libtool versioning checks
+
+# Notes:
+# - Checkout to the appropriate branch beforehand
+# master - for major release
+# ndctl-xx.y - for fixup release
+# This is important for generating the shortlog
+# - Add a temporary commit that updates the libtool versions as needed.
+# This will later become the release commit. Use --amend to add in the
+# git-version update and the message body.
+
+# Pre-reqs:
+# - libabigail (for abipkgdiff)
+# - fedpkg (for mock build)
+
+# TODO
+# - auto generate a release commit/tag message template
+# - determine the most recent kernel release and add it to the above
+# - perform documentation update for pmem.io/ndctl
+
+cleanup()
+{
+ rm -rf release
+ mkdir release/
+}
+
+err()
+{
+ echo "$1"
+ exit 1
+}
+
+parse_args()
+{
+ local args="$*"
+ grep -q "fix" <<< "$args" && rel_fix="1" || rel_fix=""
+ grep -q "ignore_rev" <<< "$args" && ignore_rev="1" || ignore_rev=""
+}
+
+check_branch()
+{
+ local cur=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
+ if [ -n "$rel_fix" ]; then
+ # fixup release, expect ndctl-xx.y branch
+ if ! grep -Eq "^ndctl.[0-9]+\.y$" <<< "$cur"; then
+ err "expected an ndctl-xx.y branch for fixup release"
+ fi
+ else
+ # major release, expect master branch
+ if ! grep -Eq "^master$" <<< "$cur"; then
+ err "expected master branch for a major release"
+ fi
+ fi
+ if ! git diff-index --quiet HEAD --; then
+ err "$cur has uncommitted/unstaged changes"
+ fi
+}
+
+last_maj()
+{
+ git tag | sort -V | grep -E "v[0-9]+$" | tail -1
+}
+
+last_fix()
+{
+ local base="$1"
+ git tag | sort -V | grep -E "$base\.?[0-9]*$" | tail -1
+}
+
+next_maj()
+{
+ local last="$1"
+ local num=${last#v}
+
+ newnum="$((num + 1))"
+ echo "v$newnum"
+}
+
+next_fix()
+{
+ local last="$1"
+ local num=${last##*.}
+ local base=${last%%.*}
+
+ newnum=$((num + 1))
+ echo "$base.$newnum"
+}
+
+gen_lists()
+{
+ local range="$1"
+
+ git shortlog "$range" > release/shortlog
+ git log --pretty=format:"%s" "$range" > release/commits
+ c_count=$(git log --pretty=format:"%s" "$range" | wc -l)
+}
+
+# Check libtool versions in Makefile.am.in
+# $1: lib name (currently libndctl or libdaxctl)
+check_libtool_vers()
+{
+ local lib="$1"
+ local lib_u="${lib^^}"
+ local libdir="${lib##lib}"
+ local symfile="${libdir}/lib/${lib}.sym"
+ local last_cur=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
+ local last_rev=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
+ local last_age=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
+ local last_soname=$((last_cur - last_age))
+ local next_cur=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
+ local next_rev=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
+ local next_age=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
+ local next_soname=$((next_cur - next_age))
+ local soname_diff=$((next_soname - last_soname))
+
+ # generally libtool versions either reset to zero or increase only by one
+ # _CURRENT monotonically increases (by one)
+ if [ "$((next_cur - last_cur))" -gt 1 ]; then
+ err "${lib_u}_CURRENT can increase at most by 1"
+ fi
+ if [ "$next_rev" -ne 0 ]; then
+ if [ "$((next_rev - last_rev))" -gt 1 ]; then
+ err "${lib_u}_REVISION can increase at most by 1"
+ fi
+ fi
+ if [ "$next_age" -ne 0 ]; then
+ if [ "$((next_age - last_age))" -gt 1 ]; then
+ err "${lib_u}_AGE can increase at most by 1"
+ fi
+ fi
+
+ # test for soname change
+ if [ "$soname_diff" -ne 0 ]; then
+ err "${lib}: expected soname to stay unchanged"
+ fi
+
+ # tests based on whether symfile changed
+ # compatibility breaking changes are left for libabigail to detect
+ test -s "$symfile" || err "$symfile: not found"
+ if [ -n "$(git diff --name-only $last_ref..HEAD $symfile)" ]; then
+ # symfile has changed, cur and age should increase
+ if [ "$((next_cur - last_cur))" -ne 1 ]; then
+ err "based on $symfile, ${lib_u}_CURRENT should've increased by 1"
+ fi
+ if [ "$((next_age - last_age))" -ne 1 ]; then
+ err "based on $symfile, ${lib_u}_AGE should've increased by 1"
+ fi
+ else
+ # no changes to symfile, revision should've increased if source changed
+ if [ -n "$ignore_rev" ]; then
+ : # skip
+ elif [ -n "$(git diff --name-only $last_ref..HEAD $libdir/)" ]; then
+ if [ "$((next_rev - last_rev))" -ne 1 ]; then
+ err "based on $symfile, ${lib_u}_REVISION should've increased by 1"
+ fi
+ fi
+ fi
+}
+
+
+# main
+cleanup
+parse_args "$*"
+check_branch
+[ -e "COPYING" ] || err "Run from the top level of an ndctl tree"
+
+last_maj=$(last_maj)
+test -n "$last_maj" || err "Unable to determine last release"
+
+last_fix=$(last_fix $last_maj)
+test -n "$last_fix" || err "Unable to determine last fixup tag for $last_maj"
+
+next_maj=$(next_maj "$last_maj")
+next_fix=$(next_fix "$last_fix")
+[ -n "$rel_fix" ] && last_ref="$last_fix" || last_ref="$last_maj"
+[ -n "$rel_fix" ] && next_ref="$next_fix" || next_ref="$next_maj"
+
+check_libtool_vers "libndctl"
+check_libtool_vers "libdaxctl"
+
+gen_lists ${last_ref}..HEAD
+
+# For ABI diff purposes, use the latest fixes tag
+contrib/do_abidiff ${last_fix}..HEAD
+
+# once everything passes, update the git-version
+sed -i -e "s/DEF_VER=[0-9]\+.*/DEF_VER=${next_ref#v}/" git-version
+
+echo "Ready to release ndctl-$next_ref with $c_count new commits."
+echo "Add git-version to the top commit to get the updated version."
+echo "Use release/commits and release/shortlog to compose the release message"
+echo "The release commit typically contains the Makefile.am.in libtool version"
+echo "update, and the git-version update."
+echo "Finally, ensure the release commit as well as the tag are PGP signed."
--
2.17.0
2 years, 8 months
linux-nvdimm 欢迎您,可以加入淘宝VIP返利项目!
by 庞林
淘宝红包返利, 微信淘宝购物返利来了!
由于您购物信誉良好, 现特别邀请您加入返利!
高返利机器人加微信:baiyunfu55
淘宝所有商品均可返利10-50%红包
这个牢骚话才发完,另一个便惊得扯嗓子大叫,“不得了!咱爷烫的就快烧起来了!”伸手一摸,可不就是烫的跟烧起来似的。
2 years, 8 months
[ndctl PATCH] ndctl, contrib: Add helper scripts for new release
by Vishal Verma
Add a couple of helper scripts to codify the release process.
First is do_abidiff: This builds RPMs for two different versions of
ndctl (specified as a git revision range, for example vXX.Y..HEAD). It
then uses abipkgdiff to determine whether the commits in that range
(collectively) introduced any compatibility breaking ABI changes.
Changing or removing a publicly exported function is considered a
breakage, where as adding new functions is acceptable.
Second is prepare-release.sh: Its primary purpose is to codify the
libtool version update. It does a variety of sanity checks to ensure we
didn't involuntarily bump the soname, or update the libtool version in
an unexpected way.
prepare-release.sh also calls do_abidiff to perform an abi check between
the last bug-fix update and the new version about to be released.
Cc: Dan Williams <dan.j.williams(a)intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
contrib/do_abidiff | 73 ++++++++++++++
contrib/prepare-release.sh | 201 +++++++++++++++++++++++++++++++++++++
2 files changed, 274 insertions(+)
create mode 100755 contrib/do_abidiff
create mode 100755 contrib/prepare-release.sh
diff --git a/contrib/do_abidiff b/contrib/do_abidiff
new file mode 100755
index 0000000..9adc93a
--- /dev/null
+++ b/contrib/do_abidiff
@@ -0,0 +1,73 @@
+#!/bin/bash -e
+
+# WARNING: This will wipe ~/rpmbuild
+
+range="$*"
+old="${range%%..*}"
+new="${range##*..}"
+
+err()
+{
+ echo "$1"
+ exit 1
+}
+
+build_rpm()
+{
+ local cur=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
+ local ref="$1"
+
+ # setup rpmbuild env
+ rpmdev-wipetree && rpmdev-setuptree
+
+ # prepare ndctl tree
+ git checkout -b rel_${ref} $ref
+ ./autogen.sh
+ ./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64
+ make clean
+ make rhel/ndctl.spec
+ mkdir -p ~/git/
+ [ -d ~/git/ndctl/ ] && err "~/git/ndctl already exists, please remove it" || true
+ cp -r $(readlink -f .) ~/git/
+
+ # build and copy RPMs
+ ./rpmbuild.sh
+ mkdir -p release/rel_${ref}/
+ cp ~/rpmbuild/RPMS/x86_64/*.rpm release/rel_${ref}/
+
+ # restore ndctl branch
+ git checkout $cur
+ git branch -D rel_${ref}
+ rm -rf ~/git/ndctl
+}
+
+do_diff()
+{
+ local pkg="$1"
+ local old_base="$(find . -regex "./release/rel_${old}/${pkg}-[0-9]+.*" | head -1)"
+ local new_base="$(find . -regex "./release/rel_${new}/${pkg}-[0-9]+.*" | head -1)"
+ local old_dev="$(find . -regex "./release/rel_${old}/${pkg}-devel-[0-9]+.*" | head -1)"
+ local new_dev="$(find . -regex "./release/rel_${new}/${pkg}-devel-[0-9]+.*" | head -1)"
+ local old_lib="$(find . -regex "./release/rel_${old}/${pkg}-libs-[0-9]+.*" | head -1)"
+ local new_lib="$(find . -regex "./release/rel_${new}/${pkg}-libs-[0-9]+.*" | head -1)"
+
+ [ -n "$pkg" ] || err "specify a package for diff (ndctl, daxctl)"
+
+ abipkgdiff --dso-only --no-added-syms --harmless --drop-private-types \
+ --devel1 "$old_dev" --devel2 "$new_dev" \
+ "$old_base" "$new_base"
+ abipkgdiff --no-added-syms --harmless --drop-private-types \
+ --devel1 "$old_dev" --devel2 "$new_dev" \
+ "$old_lib" "$new_lib"
+}
+
+[ -e "COPYING" ] || err "Run from the top level of an ndctl tree"
+if ! command -v "abipkgdiff" >/dev/null; then
+ err "missing abipkgdiff. Please install libabigail"
+fi
+rm -rf release/rel*
+
+build_rpm $old > /dev/null 2>&1
+build_rpm $new > /dev/null 2>&1
+do_diff ndctl
+do_diff daxctl
diff --git a/contrib/prepare-release.sh b/contrib/prepare-release.sh
new file mode 100755
index 0000000..2941124
--- /dev/null
+++ b/contrib/prepare-release.sh
@@ -0,0 +1,201 @@
+#!/bin/bash -e
+
+# Arguments:
+# fix - fixup release instead of a full release
+# ignore_rev - ignore the check for _REVISION in libtool versioning checks
+
+# Notes:
+# - Checkout to the appropriate branch beforehand
+# master - for major release
+# ndctl-xx.y - for fixup release
+# This is important for generating the shortlog
+# - Add a temporary commit that updates the libtool versions as needed.
+# This will later become the release commit. Use --amend to add in the
+# git-version update and the message body.
+
+# WARNING: This will wipe ~/rpmbuild
+
+# Pre-reqs:
+# - libabigail (for abipkgdiff)
+# - rpmdevtools (for rpmdev-setuptree etc)
+
+# TODO
+# - auto generate a release commit/tag message template
+# - determine the most recent kernel release and add it to the above
+# - perform documentation update for pmem.io/ndctl
+# (this needs the ndctl update to be pushed first..)
+
+cleanup()
+{
+ rm -rf release
+ mkdir release/
+}
+
+err()
+{
+ echo "$1"
+ exit 1
+}
+
+parse_args()
+{
+ local args="$*"
+ grep -q "fix" <<< "$args" && rel_fix="1" || rel_fix=""
+ grep -q "ignore_rev" <<< "$args" && ignore_rev="1" || ignore_rev=""
+}
+
+check_branch()
+{
+ local cur=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
+ if [ -n "$rel_fix" ]; then
+ # fixup release, expect ndctl-xx.y branch
+ if ! grep -Eq "^ndctl.[0-9]+\.y$" <<< "$cur"; then
+ err "expected an ndctl-xx.y branch for fixup release"
+ fi
+ else
+ # major release, expect master branch
+ if ! grep -Eq "^master$" <<< "$cur"; then
+ err "expected master branch for a major release"
+ fi
+ fi
+ if ! git diff-index --quiet HEAD --; then
+ err "$cur has uncommitted/unstaged changes"
+ fi
+}
+
+last_maj()
+{
+ git tag | sort -V | grep -E "v[0-9]+$" | tail -1
+}
+
+last_fix()
+{
+ local base="$1"
+ git tag | sort -V | grep -E "$base\.?[0-9]*$" | tail -1
+}
+
+next_maj()
+{
+ local last="$1"
+ local num=${last#v}
+
+ newnum="$((num + 1))"
+ echo "v$newnum"
+}
+
+next_fix()
+{
+ local last="$1"
+ local num=${last##*.}
+ local base=${last%%.*}
+
+ newnum=$((num + 1))
+ echo "$base.$newnum"
+}
+
+gen_lists()
+{
+ local range="$1"
+
+ git shortlog "$range" > release/shortlog
+ git log --pretty=format:"%s" "$range" > release/commits
+ c_count=$(git log --pretty=format:"%s" "$range" | wc -l)
+}
+
+# Check libtool versions in Makefile.am.in
+# $1: lib name (currently libndctl or libdaxctl)
+check_libtool_vers()
+{
+ local lib="$1"
+ local lib_u="${lib^^}"
+ local libdir="${lib##lib}"
+ local symfile="${libdir}/lib/${lib}.sym"
+ local last_cur=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
+ local last_rev=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
+ local last_age=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
+ local last_soname=$((last_cur - last_age))
+ local next_cur=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
+ local next_rev=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
+ local next_age=$(git show HEAD:Makefile.am.in | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
+ local next_soname=$((next_cur - next_age))
+ local soname_diff=$((next_soname - last_soname))
+
+ # generally libtool versions either reset to zero or increase only by one
+ # _CURRENT monotonically increases (by one)
+ if [ "$((next_cur - last_cur))" -gt 1 ]; then
+ err "${lib_u}_CURRENT can increase at most by 1"
+ fi
+ if [ "$next_rev" -ne 0 ]; then
+ if [ "$((next_rev - last_rev))" -gt 1 ]; then
+ err "${lib_u}_REVISION can increase at most by 1"
+ fi
+ fi
+ if [ "$next_age" -ne 0 ]; then
+ if [ "$((next_age - last_age))" -gt 1 ]; then
+ err "${lib_u}_AGE can increase at most by 1"
+ fi
+ fi
+
+ # test for soname change
+ if [ "$soname_diff" -ne 0 ]; then
+ err "${lib}: expected soname to stay unchanged"
+ fi
+
+ # tests based on whether symfile changed
+ # compatibility breaking changes are left for libabigail to detect
+ test -s "$symfile" || err "$symfile: not found"
+ if [ -n "$(git diff --name-only $last_ref..HEAD $symfile)" ]; then
+ # symfile has changed, cur and age should increase
+ if [ "$((next_cur - last_cur))" -ne 1 ]; then
+ err "based on $symfile, ${lib_u}_CURRENT should've increased by 1"
+ fi
+ if [ "$((next_age - last_age))" -ne 1 ]; then
+ err "based on $symfile, ${lib_u}_AGE should've increased by 1"
+ fi
+ else
+ # no changes to symfile, revision should've increased if source changed
+ if [ -n "$ignore_rev" ]; then
+ : # skip
+ elif [ -n "$(git diff --name-only $last_ref..HEAD $libdir/)" ]; then
+ if [ "$((next_rev - last_rev))" -ne 1 ]; then
+ err "based on $symfile, ${lib_u}_REVISION should've increased by 1"
+ fi
+ fi
+ fi
+}
+
+
+# main
+cleanup
+parse_args "$*"
+check_branch
+[ -e "COPYING" ] || err "Run from the top level of an ndctl tree"
+
+last_maj=$(last_maj)
+test -n "$last_maj" || err "Unable to determine last release"
+
+last_fix=$(last_fix $last_maj)
+test -n "$last_fix" || err "Unable to determine last fixup tag for $last_maj"
+
+next_maj=$(next_maj "$last_maj")
+next_fix=$(next_fix "$last_fix")
+[ -n "$rel_fix" ] && last_ref="$last_fix" || last_ref="$last_maj"
+[ -n "$rel_fix" ] && next_ref="$next_fix" || next_ref="$next_maj"
+
+check_libtool_vers "libndctl"
+check_libtool_vers "libdaxctl"
+
+gen_lists ${last_ref}..HEAD
+
+# For ABI diff purposes, use the latest fixes tag
+contrib/do_abidiff ${last_fix}..HEAD
+
+# once everything passes, update the git-version
+sed -i -e "s/DEF_VER=[0-9]\+.*/DEF_VER=${next_ref#v}/" git-version
+
+echo "Ready to release ndctl-$next_ref with $c_count new commits."
+echo "Add git-version to the top commit to get the updated version."
+echo "Use release/commits and release/shortlog to compose the release message"
+echo "The release commit typically contains the Makefile.am.in libtool version"
+echo "update, and the git-version update."
+echo "Finally, ensure the release commit as well as the tag are PGP signed."
--
2.17.0
2 years, 8 months
[PATCH 0/3] libvdimm: Support namespace enumeration while locked
by Dan Williams
The NVDIMM_FAMILY_INTEL DSM path for manipulating labels explicitly
allows reading the namespace label area while the DIMM is locked. In
contrast the ACPI _LSR method for reading labels only indicates if the
label area is locked and returns no data.
It naturally follows that if the namespace label area is locked, the
DIMM is locked since the driver is prevented from discovering namespace
boundaries.
On platforms where both mechanisms are available, prefer the
NVDIMM_FAMILY_INTEL implementation and support enumerating namespace
boundaries while the DIMM is locked.
In addition to ACPI capability detection and the libnvdimm core change
to fail probe of locked namespaces, provide a capability to inject this
semantic difference via nfit_test.
---
Dan Williams (3):
libnvdimm: Introduce locked DIMM capacity support
acpi, nfit: Prefer _DSM over _LSR for namespace label reads
tools/testing/nvdimm: Make DSM failure code injection an override
drivers/acpi/nfit/core.c | 12 +++++++++
drivers/nvdimm/dimm.c | 24 +++++++++++++++++--
drivers/nvdimm/namespace_devs.c | 23 ++++++++++++++++++
drivers/nvdimm/nd.h | 1 +
tools/testing/nvdimm/test/nfit.c | 49 +++++++++++++++++++++++++-------------
5 files changed, 89 insertions(+), 20 deletions(-)
2 years, 8 months
[PATCH] tools/testing/nvdimm: Fix support for emulating controller temperature
by Dan Williams
In addition to populating the value the payload also needs to set the
"controller temperature valid" flag.
Fixes: cdd77d3e1930 ("nfit, libnvdimm: deprecate the generic SMART ioctl")
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
tools/testing/nvdimm/test/nfit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 6f19d6e28f5f..15dc280eb3ae 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -1321,7 +1321,8 @@ static void smart_init(struct nfit_test *t)
| ND_INTEL_SMART_ALARM_VALID
| ND_INTEL_SMART_USED_VALID
| ND_INTEL_SMART_SHUTDOWN_VALID
- | ND_INTEL_SMART_MTEMP_VALID,
+ | ND_INTEL_SMART_MTEMP_VALID
+ | ND_INTEL_SMART_CTEMP_VALID,
.health = ND_INTEL_SMART_NON_CRITICAL_HEALTH,
.media_temperature = 23 * 16,
.ctrl_temperature = 25 * 16,
2 years, 8 months
[ndctl PATCH 1/2] ndctl, list: Add controller temperature
by Dan Williams
Emit the controller temperature if the smart payload includes this
field.
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
ndctl/util/json-smart.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/ndctl/util/json-smart.c b/ndctl/util/json-smart.c
index 4020423bb8c8..9482b35a43d6 100644
--- a/ndctl/util/json-smart.c
+++ b/ndctl/util/json-smart.c
@@ -109,6 +109,16 @@ struct json_object *util_dimm_health_to_json(struct ndctl_dimm *dimm)
json_object_object_add(jhealth, "temperature_celsius", jobj);
}
+ if (flags & ND_SMART_CTEMP_VALID) {
+ unsigned int temp = ndctl_cmd_smart_get_ctrl_temperature(cmd);
+ double t = ndctl_decode_smart_temperature(temp);
+
+ jobj = json_object_new_double(t);
+ if (jobj)
+ json_object_object_add(jhealth,
+ "controller_temperature_celsius", jobj);
+ }
+
if (flags & ND_SMART_SPARES_VALID) {
unsigned int spares = ndctl_cmd_smart_get_spares(cmd);
2 years, 8 months