numam-spdk/test
Tomasz Zawadzki 69a8877e82 lib/blob: do not allow xattr to exceed maximum descriptor length
Length of xattr descriptor is equal to length of xattr struct,
xattr name and the len of stored value.

There is no limit to how much can be stored in memory for xattr.
On disk xattr size is limited to single page and within that to
max descriptors that can fit in it.
This size is known at compile time.

Before this patch it was possible to add xattr exceeding
what was possible to be written to disk. This caused issues
when serializing the metadata during spdk_blob_sync_md()
or spdk_blob_close(). Making those fail without specific info
to the user and not actually writting such descriptor.

Since maximum length of xattr descriptor is known at compile time,
this patch compares against this value when setting the xattr.
It will immediately report back to user with error, and will
not store xattr in memory (thus not serialize it).

This patch should not affect any backward compatibility for blobs.
Too large xattrs weren't written to disk before,
API for blobstore stays the same - only reporting ENOMEM
when it should.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6f4af4d079e47f084e20d7a4969d9a78ec1f8610
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460450
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-11 10:05:41 +00:00
..
app test: add a fuzzer for the vhost API 2019-07-08 09:18:19 +00:00
bdev bdevperf: do not start tests until RPC is sent 2019-07-10 05:11:25 +00:00
blobfs test/rocksdb: remove run_tests.sh 2019-07-05 12:13:16 +00:00
blobstore test: remove duplicated set -ex from tests 2019-06-19 03:54:58 +00:00
common test: add top level param for nvmf transport. 2019-07-09 13:23:03 +00:00
config_converter iscsi: Deprecate MinConnectionsPerCore 2019-05-06 17:10:48 +00:00
cpp_headers Makefile: Add possibility to uninstall spdk. 2019-05-16 20:56:18 +00:00
env test/nvme: Allow NVMe with 0 namespaces in tests 2019-07-08 09:39:09 +00:00
event notify: add notification library 2019-03-29 21:15:14 +00:00
ftl lib/ftl: Expand restore tests 2019-06-26 07:09:00 +00:00
ioat test: remove duplicated set -ex from tests 2019-06-19 03:54:58 +00:00
iscsi_tgt test/iscsi_tgt: remove drive size dependency 2019-07-09 07:49:51 +00:00
json_config scripts: replace egrep with grep -E 2019-07-05 12:06:10 +00:00
lvol test: remove duplicated set -ex from tests 2019-06-19 03:54:58 +00:00
nvme nvme/tests: Enable testing multinamespace NVMe 2019-07-08 09:39:09 +00:00
nvmf test/nvmf: remove extra call to perf. 2019-07-09 13:23:03 +00:00
ocf test/ocf: disable persistent metadata test 2019-06-11 18:16:55 +00:00
pmem test/pmem: cleanup common.sh 2019-06-19 03:54:58 +00:00
rpc_client test: remove duplicated set -ex from tests 2019-06-19 03:54:58 +00:00
spdkcli spdkcli/test: remove unnecessary test output 2019-07-10 06:54:58 +00:00
unit lib/blob: do not allow xattr to exceed maximum descriptor length 2019-07-11 10:05:41 +00:00
vhost test: add a fuzzer for the vhost API 2019-07-08 09:18:19 +00:00
Makefile jsonrpc-client: add new C client library 2018-10-11 20:07:44 +00:00
spdk_cunit.h test: remove leftover spdk_cunit declaration 2018-07-06 22:47:56 +00:00