mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
Compare commits
126 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 04b02785b6 | |||
| f22254283a | |||
| 7319a73921 | |||
| 596cfb6b15 | |||
| f806306ce0 | |||
| f33b298346 | |||
| 04fcf13de0 | |||
| 37dbf91c8a | |||
| be697f4339 | |||
| c07a8660f0 | |||
| ea62fb4ab7 | |||
| 5aca6e1092 | |||
| d72e004715 | |||
| 9ef565a185 | |||
| 0e72f5fb83 | |||
| e9897e542d | |||
| 70b1b5bb98 | |||
| a2aabac123 | |||
| 3207803abf | |||
| 6219190d7f | |||
| 24a6d8316a | |||
| e23ed1b330 | |||
| 572114d846 | |||
| 6af8e80310 | |||
| f8a124b104 | |||
| 689c53f2c5 | |||
| 0156253d29 | |||
| 3e0962a236 | |||
| 3c0b8c874b | |||
| b586ea5d93 | |||
| 138d2b29dd | |||
| 5371d8dae7 | |||
| a75af541cf | |||
| 75fbe7eb99 | |||
| d0f350c962 | |||
| 2f2d6bece8 | |||
| fbbc375d43 | |||
| e84a2ed7a8 | |||
| f28c7302cb | |||
| 4767037bcf | |||
| d50ce5c9ec | |||
| 05732da4d1 | |||
| 8f7826f73b | |||
| 21bd766133 | |||
| 7819b12f2c | |||
| c8d2ab05e1 | |||
| 2c50512ad2 | |||
| c4468a70c3 | |||
| e48aaef89f | |||
| 0e3abd2994 | |||
| 3d1e808096 | |||
| 108c07c655 | |||
| 32f7499acf | |||
| 670d66e7a0 | |||
| ad0379bf0e | |||
| 2662b8e72b | |||
| fa7d572a8a | |||
| d9de079a4b | |||
| 957c3776f2 | |||
| 85537f77a3 | |||
| 5f53a444b3 | |||
| 572bd18c1f | |||
| 256b74d0b0 | |||
| ac01b876c9 | |||
| e9a8fb17b5 | |||
| 52e658edd7 | |||
| 4c59fde1f5 | |||
| 3830858c5c | |||
| af2e53f62c | |||
| 89c41f3979 | |||
| 409c99a1d3 | |||
| bbec0e60a8 | |||
| a5f17a94d3 | |||
| 5eaad8bdb5 | |||
| 4351d18fb0 | |||
| 2453f90350 | |||
| d016ca1a92 | |||
| d05f247aec | |||
| fa74250cd3 | |||
| c562bbefc0 | |||
| d4df36de5d | |||
| 531361114b | |||
| e11c4327f1 | |||
| fbe150fe5b | |||
| 1ff8f41851 | |||
| c6d93d0a80 | |||
| 9f1691a964 | |||
| 12b859c970 | |||
| 39a39b8ab9 | |||
| 1d5e569a69 | |||
| 3f380df778 | |||
| b247d47be1 | |||
| 792825724b | |||
| ab22031d79 | |||
| 33bc03dea7 | |||
| ee93cbc9d4 | |||
| 1d9aa838ed | |||
| 0f4ee295ba | |||
| 8c0684d326 | |||
| ca3a675c74 | |||
| cd1f023846 | |||
| b27c7a1457 | |||
| 186e39f336 | |||
| 1d2b0563f7 | |||
| 8929355b4c | |||
| 212ba9bd97 | |||
| 7ce097c874 | |||
| 3e767e34bd | |||
| df000276b8 | |||
| 7a1b6c51d0 | |||
| 4dd9c3b08e | |||
| 1bbc09e1f7 | |||
| 37d5a3e04b | |||
| 25096e1180 | |||
| 820edcbf91 | |||
| 37763ea2a6 | |||
| c8d6a91a99 | |||
| 7ac732b8d6 | |||
| 04f1983aab | |||
| 4e3fecbdfd | |||
| fc1c0053f9 | |||
| 7795975681 | |||
| 3b935cc3ed | |||
| b0bc882395 | |||
| 8cf59e97c4 | |||
| 4d22befde6 |
@@ -8,7 +8,7 @@ jobs:
|
|||||||
checkstyle:
|
checkstyle:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
if: failure() && steps.CheckABI.outcome == 'failure'
|
if: failure() && steps.CheckABI.outcome == 'failure'
|
||||||
run: |
|
run: |
|
||||||
find -name *.abi | tar -cf abi_files.tar -T -
|
find -name *.abi | tar -cf abi_files.tar -T -
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
if: failure() && steps.CheckABI.outcome == 'failure'
|
if: failure() && steps.CheckABI.outcome == 'failure'
|
||||||
with:
|
with:
|
||||||
name: New ABI files (use only if you're sure about interface changes)
|
name: New ABI files (use only if you're sure about interface changes)
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [18.04, 20.04]
|
os: [20.04]
|
||||||
runs-on: ubuntu-${{ matrix.os }}
|
runs-on: ubuntu-${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -75,7 +75,7 @@ jobs:
|
|||||||
sudo chmod +r $RESULTS_PATH/*
|
sudo chmod +r $RESULTS_PATH/*
|
||||||
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
||||||
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
|
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: Test logs Ubuntu-${{ matrix.os }}
|
name: Test logs Ubuntu-${{ matrix.os }}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -71,7 +71,7 @@ jobs:
|
|||||||
sudo chmod +r $RESULTS_PATH/*
|
sudo chmod +r $RESULTS_PATH/*
|
||||||
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
||||||
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
|
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: Test logs
|
name: Test logs
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
env:
|
env:
|
||||||
TEST_DIR: /var/tmp/zloop
|
TEST_DIR: /var/tmp/zloop
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
sudo chmod +r -R $TEST_DIR/
|
sudo chmod +r -R $TEST_DIR/
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: Logs
|
name: Logs
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
/var/tmp/zloop/*/
|
/var/tmp/zloop/*/
|
||||||
!/var/tmp/zloop/*/vdev/
|
!/var/tmp/zloop/*/vdev/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: Pool files
|
name: Pool files
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
The [OpenZFS Code of Conduct](http://www.open-zfs.org/wiki/Code_of_Conduct)
|
The [OpenZFS Code of Conduct](https://openzfs.org/wiki/Code_of_Conduct)
|
||||||
applies to spaces associated with the OpenZFS project, including GitHub.
|
applies to spaces associated with the OpenZFS project, including GitHub.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
Meta: 1
|
Meta: 1
|
||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 2.1.6
|
Version: 2.1.8
|
||||||
Release: 1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 5.19
|
Linux-Maximum: 6.1
|
||||||
Linux-Minimum: 3.10
|
Linux-Minimum: 3.10
|
||||||
|
|||||||
@@ -686,9 +686,9 @@ def section_archits(kstats_dict):
|
|||||||
print()
|
print()
|
||||||
print('Cache hits by data type:')
|
print('Cache hits by data type:')
|
||||||
dt_todo = (('Demand data:', arc_stats['demand_data_hits']),
|
dt_todo = (('Demand data:', arc_stats['demand_data_hits']),
|
||||||
('Demand prefetch data:', arc_stats['prefetch_data_hits']),
|
('Prefetch data:', arc_stats['prefetch_data_hits']),
|
||||||
('Demand metadata:', arc_stats['demand_metadata_hits']),
|
('Demand metadata:', arc_stats['demand_metadata_hits']),
|
||||||
('Demand prefetch metadata:',
|
('Prefetch metadata:',
|
||||||
arc_stats['prefetch_metadata_hits']))
|
arc_stats['prefetch_metadata_hits']))
|
||||||
|
|
||||||
for title, value in dt_todo:
|
for title, value in dt_todo:
|
||||||
@@ -697,10 +697,10 @@ def section_archits(kstats_dict):
|
|||||||
print()
|
print()
|
||||||
print('Cache misses by data type:')
|
print('Cache misses by data type:')
|
||||||
dm_todo = (('Demand data:', arc_stats['demand_data_misses']),
|
dm_todo = (('Demand data:', arc_stats['demand_data_misses']),
|
||||||
('Demand prefetch data:',
|
('Prefetch data:',
|
||||||
arc_stats['prefetch_data_misses']),
|
arc_stats['prefetch_data_misses']),
|
||||||
('Demand metadata:', arc_stats['demand_metadata_misses']),
|
('Demand metadata:', arc_stats['demand_metadata_misses']),
|
||||||
('Demand prefetch metadata:',
|
('Prefetch metadata:',
|
||||||
arc_stats['prefetch_metadata_misses']))
|
arc_stats['prefetch_metadata_misses']))
|
||||||
|
|
||||||
for title, value in dm_todo:
|
for title, value in dm_todo:
|
||||||
|
|||||||
+1
-1
@@ -2995,7 +2995,7 @@ open_objset(const char *path, void *tag, objset_t **osp)
|
|||||||
}
|
}
|
||||||
sa_os = *osp;
|
sa_os = *osp;
|
||||||
|
|
||||||
return (0);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -599,6 +599,7 @@ fmd_timer_install(fmd_hdl_t *hdl, void *arg, fmd_event_t *ep, hrtime_t delta)
|
|||||||
sev.sigev_notify_function = _timer_notify;
|
sev.sigev_notify_function = _timer_notify;
|
||||||
sev.sigev_notify_attributes = NULL;
|
sev.sigev_notify_attributes = NULL;
|
||||||
sev.sigev_value.sival_ptr = ftp;
|
sev.sigev_value.sival_ptr = ftp;
|
||||||
|
sev.sigev_signo = 0;
|
||||||
|
|
||||||
timer_create(CLOCK_REALTIME, &sev, &ftp->ft_tid);
|
timer_create(CLOCK_REALTIME, &sev, &ftp->ft_tid);
|
||||||
timer_settime(ftp->ft_tid, 0, &its, NULL);
|
timer_settime(ftp->ft_tid, 0, &its, NULL);
|
||||||
|
|||||||
+27
-17
@@ -525,6 +525,7 @@ typedef struct dev_data {
|
|||||||
boolean_t dd_islabeled;
|
boolean_t dd_islabeled;
|
||||||
uint64_t dd_pool_guid;
|
uint64_t dd_pool_guid;
|
||||||
uint64_t dd_vdev_guid;
|
uint64_t dd_vdev_guid;
|
||||||
|
uint64_t dd_new_vdev_guid;
|
||||||
const char *dd_new_devid;
|
const char *dd_new_devid;
|
||||||
} dev_data_t;
|
} dev_data_t;
|
||||||
|
|
||||||
@@ -535,6 +536,7 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
|
|||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
uint_t c, children;
|
uint_t c, children;
|
||||||
nvlist_t **child;
|
nvlist_t **child;
|
||||||
|
uint64_t guid = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First iterate over any children.
|
* First iterate over any children.
|
||||||
@@ -562,17 +564,14 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
|
|||||||
/* once a vdev was matched and processed there is nothing left to do */
|
/* once a vdev was matched and processed there is nothing left to do */
|
||||||
if (dp->dd_found)
|
if (dp->dd_found)
|
||||||
return;
|
return;
|
||||||
|
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_GUID, &guid);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Match by GUID if available otherwise fallback to devid or physical
|
* Match by GUID if available otherwise fallback to devid or physical
|
||||||
*/
|
*/
|
||||||
if (dp->dd_vdev_guid != 0) {
|
if (dp->dd_vdev_guid != 0) {
|
||||||
uint64_t guid;
|
if (guid != dp->dd_vdev_guid)
|
||||||
|
|
||||||
if (nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_GUID,
|
|
||||||
&guid) != 0 || guid != dp->dd_vdev_guid) {
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
zed_log_msg(LOG_INFO, " zfs_iter_vdev: matched on %llu", guid);
|
zed_log_msg(LOG_INFO, " zfs_iter_vdev: matched on %llu", guid);
|
||||||
dp->dd_found = B_TRUE;
|
dp->dd_found = B_TRUE;
|
||||||
|
|
||||||
@@ -582,6 +581,12 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
|
|||||||
* illumos, substring matching is not required to accommodate
|
* illumos, substring matching is not required to accommodate
|
||||||
* the partition suffix. An exact match will be present in
|
* the partition suffix. An exact match will be present in
|
||||||
* the dp->dd_compare value.
|
* the dp->dd_compare value.
|
||||||
|
* If the attached disk already contains a vdev GUID, it means
|
||||||
|
* the disk is not clean. In such a scenario, the physical path
|
||||||
|
* would be a match that makes the disk faulted when trying to
|
||||||
|
* online it. So, we would only want to proceed if either GUID
|
||||||
|
* matches with the last attached disk or the disk is in clean
|
||||||
|
* state.
|
||||||
*/
|
*/
|
||||||
if (nvlist_lookup_string(nvl, dp->dd_prop, &path) != 0 ||
|
if (nvlist_lookup_string(nvl, dp->dd_prop, &path) != 0 ||
|
||||||
strcmp(dp->dd_compare, path) != 0) {
|
strcmp(dp->dd_compare, path) != 0) {
|
||||||
@@ -589,6 +594,12 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
|
|||||||
__func__, dp->dd_compare, path);
|
__func__, dp->dd_compare, path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (dp->dd_new_vdev_guid != 0 && dp->dd_new_vdev_guid != guid) {
|
||||||
|
zed_log_msg(LOG_INFO, " %s: no match (GUID:%llu"
|
||||||
|
" != vdev GUID:%llu)", __func__,
|
||||||
|
dp->dd_new_vdev_guid, guid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zed_log_msg(LOG_INFO, " zfs_iter_vdev: matched %s on %s",
|
zed_log_msg(LOG_INFO, " zfs_iter_vdev: matched %s on %s",
|
||||||
dp->dd_prop, path);
|
dp->dd_prop, path);
|
||||||
@@ -670,7 +681,7 @@ zfs_iter_pool(zpool_handle_t *zhp, void *data)
|
|||||||
*/
|
*/
|
||||||
static boolean_t
|
static boolean_t
|
||||||
devphys_iter(const char *physical, const char *devid, zfs_process_func_t func,
|
devphys_iter(const char *physical, const char *devid, zfs_process_func_t func,
|
||||||
boolean_t is_slice)
|
boolean_t is_slice, uint64_t new_vdev_guid)
|
||||||
{
|
{
|
||||||
dev_data_t data = { 0 };
|
dev_data_t data = { 0 };
|
||||||
|
|
||||||
@@ -680,6 +691,7 @@ devphys_iter(const char *physical, const char *devid, zfs_process_func_t func,
|
|||||||
data.dd_found = B_FALSE;
|
data.dd_found = B_FALSE;
|
||||||
data.dd_islabeled = is_slice;
|
data.dd_islabeled = is_slice;
|
||||||
data.dd_new_devid = devid; /* used by auto replace code */
|
data.dd_new_devid = devid; /* used by auto replace code */
|
||||||
|
data.dd_new_vdev_guid = new_vdev_guid;
|
||||||
|
|
||||||
(void) zpool_iter(g_zfshdl, zfs_iter_pool, &data);
|
(void) zpool_iter(g_zfshdl, zfs_iter_pool, &data);
|
||||||
|
|
||||||
@@ -848,7 +860,7 @@ zfs_deliver_add(nvlist_t *nvl, boolean_t is_lofi)
|
|||||||
if (devid_iter(devid, zfs_process_add, is_slice))
|
if (devid_iter(devid, zfs_process_add, is_slice))
|
||||||
return (0);
|
return (0);
|
||||||
if (devpath != NULL && devphys_iter(devpath, devid, zfs_process_add,
|
if (devpath != NULL && devphys_iter(devpath, devid, zfs_process_add,
|
||||||
is_slice))
|
is_slice, vdev_guid))
|
||||||
return (0);
|
return (0);
|
||||||
if (vdev_guid != 0)
|
if (vdev_guid != 0)
|
||||||
(void) guid_iter(pool_guid, vdev_guid, devid, zfs_process_add,
|
(void) guid_iter(pool_guid, vdev_guid, devid, zfs_process_add,
|
||||||
@@ -938,14 +950,13 @@ vdev_whole_disk_from_config(zpool_handle_t *zhp, const char *vdev_path)
|
|||||||
{
|
{
|
||||||
nvlist_t *nvl = NULL;
|
nvlist_t *nvl = NULL;
|
||||||
boolean_t avail_spare, l2cache, log;
|
boolean_t avail_spare, l2cache, log;
|
||||||
uint64_t wholedisk;
|
uint64_t wholedisk = 0;
|
||||||
|
|
||||||
nvl = zpool_find_vdev(zhp, vdev_path, &avail_spare, &l2cache, &log);
|
nvl = zpool_find_vdev(zhp, vdev_path, &avail_spare, &l2cache, &log);
|
||||||
if (!nvl)
|
if (!nvl)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
verify(nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_WHOLE_DISK,
|
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk);
|
||||||
&wholedisk) == 0);
|
|
||||||
|
|
||||||
return (wholedisk);
|
return (wholedisk);
|
||||||
}
|
}
|
||||||
@@ -965,7 +976,7 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data)
|
|||||||
nvlist_t *tgt;
|
nvlist_t *tgt;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
char *tmp_devname, devname[MAXPATHLEN];
|
char *tmp_devname, devname[MAXPATHLEN] = "";
|
||||||
uint64_t guid;
|
uint64_t guid;
|
||||||
|
|
||||||
if (nvlist_lookup_uint64(udev_nvl, ZFS_EV_VDEV_GUID, &guid) == 0) {
|
if (nvlist_lookup_uint64(udev_nvl, ZFS_EV_VDEV_GUID, &guid) == 0) {
|
||||||
@@ -984,7 +995,7 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data)
|
|||||||
if ((tgt = zpool_find_vdev_by_physpath(zhp, devname,
|
if ((tgt = zpool_find_vdev_by_physpath(zhp, devname,
|
||||||
&avail_spare, &l2cache, NULL)) != NULL) {
|
&avail_spare, &l2cache, NULL)) != NULL) {
|
||||||
char *path, fullpath[MAXPATHLEN];
|
char *path, fullpath[MAXPATHLEN];
|
||||||
uint64_t wholedisk;
|
uint64_t wholedisk = 0;
|
||||||
|
|
||||||
error = nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH, &path);
|
error = nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH, &path);
|
||||||
if (error) {
|
if (error) {
|
||||||
@@ -992,10 +1003,8 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
error = nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
|
(void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
|
||||||
&wholedisk);
|
&wholedisk);
|
||||||
if (error)
|
|
||||||
wholedisk = 0;
|
|
||||||
|
|
||||||
if (wholedisk) {
|
if (wholedisk) {
|
||||||
path = strrchr(path, '/');
|
path = strrchr(path, '/');
|
||||||
@@ -1125,6 +1134,7 @@ zfs_deliver_dle(nvlist_t *nvl)
|
|||||||
strlcpy(name, devname, MAXPATHLEN);
|
strlcpy(name, devname, MAXPATHLEN);
|
||||||
zfs_append_partition(name, MAXPATHLEN);
|
zfs_append_partition(name, MAXPATHLEN);
|
||||||
} else {
|
} else {
|
||||||
|
sprintf(name, "unknown");
|
||||||
zed_log_msg(LOG_INFO, "zfs_deliver_dle: no guid or physpath");
|
zed_log_msg(LOG_INFO, "zfs_deliver_dle: no guid or physpath");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1214,7 +1224,7 @@ zfs_enum_pools(void *arg)
|
|||||||
* For now, each agent has its own libzfs instance
|
* For now, each agent has its own libzfs instance
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
zfs_slm_init()
|
zfs_slm_init(void)
|
||||||
{
|
{
|
||||||
if ((g_zfshdl = libzfs_init()) == NULL)
|
if ((g_zfshdl = libzfs_init()) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
@@ -1240,7 +1250,7 @@ zfs_slm_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zfs_slm_fini()
|
zfs_slm_fini(void)
|
||||||
{
|
{
|
||||||
unavailpool_t *pool;
|
unavailpool_t *pool;
|
||||||
pendingdev_t *device;
|
pendingdev_t *device;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ if [ "${ZEVENT_VDEV_STATE_STR}" != "FAULTED" ] \
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
umask 077
|
umask 077
|
||||||
note_subject="ZFS device fault for pool ${ZEVENT_POOL_GUID} on $(hostname)"
|
note_subject="ZFS device fault for pool ${ZEVENT_POOL} on $(hostname)"
|
||||||
note_pathname="$(mktemp)"
|
note_pathname="$(mktemp)"
|
||||||
{
|
{
|
||||||
if [ "${ZEVENT_VDEV_STATE_STR}" = "FAULTED" ] ; then
|
if [ "${ZEVENT_VDEV_STATE_STR}" = "FAULTED" ] ; then
|
||||||
@@ -65,7 +65,7 @@ note_pathname="$(mktemp)"
|
|||||||
[ -n "${ZEVENT_VDEV_GUID}" ] && echo " vguid: ${ZEVENT_VDEV_GUID}"
|
[ -n "${ZEVENT_VDEV_GUID}" ] && echo " vguid: ${ZEVENT_VDEV_GUID}"
|
||||||
[ -n "${ZEVENT_VDEV_DEVID}" ] && echo " devid: ${ZEVENT_VDEV_DEVID}"
|
[ -n "${ZEVENT_VDEV_DEVID}" ] && echo " devid: ${ZEVENT_VDEV_DEVID}"
|
||||||
|
|
||||||
echo " pool: ${ZEVENT_POOL_GUID}"
|
echo " pool: ${ZEVENT_POOL} (${ZEVENT_POOL_GUID})"
|
||||||
|
|
||||||
} > "${note_pathname}"
|
} > "${note_pathname}"
|
||||||
|
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ zed_udev_monitor(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
zed_disk_event_init()
|
zed_disk_event_init(void)
|
||||||
{
|
{
|
||||||
int fd, fflags;
|
int fd, fflags;
|
||||||
|
|
||||||
@@ -438,7 +438,7 @@ zed_disk_event_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zed_disk_event_fini()
|
zed_disk_event_fini(void)
|
||||||
{
|
{
|
||||||
/* cancel monitor thread at recvmsg() */
|
/* cancel monitor thread at recvmsg() */
|
||||||
(void) pthread_cancel(g_mon_tid);
|
(void) pthread_cancel(g_mon_tid);
|
||||||
@@ -456,13 +456,13 @@ zed_disk_event_fini()
|
|||||||
#include "zed_disk_event.h"
|
#include "zed_disk_event.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
zed_disk_event_init()
|
zed_disk_event_init(void)
|
||||||
{
|
{
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zed_disk_event_fini()
|
zed_disk_event_fini(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8535,7 +8535,7 @@ static int
|
|||||||
zfs_do_wait(int argc, char **argv)
|
zfs_do_wait(int argc, char **argv)
|
||||||
{
|
{
|
||||||
boolean_t enabled[ZFS_WAIT_NUM_ACTIVITIES];
|
boolean_t enabled[ZFS_WAIT_NUM_ACTIVITIES];
|
||||||
int error, i;
|
int error = 0, i;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
/* By default, wait for all types of activity. */
|
/* By default, wait for all types of activity. */
|
||||||
|
|||||||
@@ -5414,7 +5414,13 @@ print_zpool_dir_scripts(char *dirpath)
|
|||||||
if ((dir = opendir(dirpath)) != NULL) {
|
if ((dir = opendir(dirpath)) != NULL) {
|
||||||
/* print all the files and directories within directory */
|
/* print all the files and directories within directory */
|
||||||
while ((ent = readdir(dir)) != NULL) {
|
while ((ent = readdir(dir)) != NULL) {
|
||||||
sprintf(fullpath, "%s/%s", dirpath, ent->d_name);
|
if (snprintf(fullpath, sizeof (fullpath), "%s/%s",
|
||||||
|
dirpath, ent->d_name) >= sizeof (fullpath)) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("internal error: "
|
||||||
|
"ZPOOL_SCRIPTS_PATH too large.\n"));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Print the scripts */
|
/* Print the scripts */
|
||||||
if (stat(fullpath, &dir_stat) == 0)
|
if (stat(fullpath, &dir_stat) == 0)
|
||||||
|
|||||||
@@ -363,9 +363,6 @@ zstream_do_dump(int argc, char *argv[])
|
|||||||
BSWAP_64(drrb->drr_fromguid);
|
BSWAP_64(drrb->drr_fromguid);
|
||||||
}
|
}
|
||||||
|
|
||||||
featureflags =
|
|
||||||
DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
|
|
||||||
|
|
||||||
(void) printf("BEGIN record\n");
|
(void) printf("BEGIN record\n");
|
||||||
(void) printf("\thdrtype = %lld\n",
|
(void) printf("\thdrtype = %lld\n",
|
||||||
DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo));
|
DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo));
|
||||||
@@ -465,6 +462,9 @@ zstream_do_dump(int argc, char *argv[])
|
|||||||
BSWAP_64(drro->drr_maxblkid);
|
BSWAP_64(drro->drr_maxblkid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
featureflags =
|
||||||
|
DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
|
||||||
|
|
||||||
if (featureflags & DMU_BACKUP_FEATURE_RAW &&
|
if (featureflags & DMU_BACKUP_FEATURE_RAW &&
|
||||||
drro->drr_bonuslen > drro->drr_raw_bonuslen) {
|
drro->drr_bonuslen > drro->drr_raw_bonuslen) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
|
|||||||
@@ -2193,6 +2193,7 @@ ztest_replay_write(void *arg1, void *arg2, boolean_t byteswap)
|
|||||||
* but not always, because we also want to verify correct
|
* but not always, because we also want to verify correct
|
||||||
* behavior when the data was not recently read into cache.
|
* behavior when the data was not recently read into cache.
|
||||||
*/
|
*/
|
||||||
|
ASSERT(doi.doi_data_block_size);
|
||||||
ASSERT0(offset % doi.doi_data_block_size);
|
ASSERT0(offset % doi.doi_data_block_size);
|
||||||
if (ztest_random(4) != 0) {
|
if (ztest_random(4) != 0) {
|
||||||
int prefetch = ztest_random(2) ?
|
int prefetch = ztest_random(2) ?
|
||||||
|
|||||||
@@ -109,6 +109,13 @@ while [ "$outer_loop" -lt 20 ]; do
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# zvol_count made some progress - let's stay in this loop.
|
||||||
|
#
|
||||||
|
if [ "$old_zvols_count" -gt "$zvols_count" ]; then
|
||||||
|
outer_loop=$((outer_loop - 1))
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Timed out waiting on zvol links"
|
echo "Timed out waiting on zvol links"
|
||||||
|
|||||||
@@ -46,6 +46,16 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
|
|||||||
])
|
])
|
||||||
AC_SUBST(DEFINE_PYZFS)
|
AC_SUBST(DEFINE_PYZFS)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Autodetection disables pyzfs if kernel or srpm config
|
||||||
|
dnl #
|
||||||
|
AS_IF([test "x$enable_pyzfs" = xcheck], [
|
||||||
|
AS_IF([test "x$ZFS_CONFIG" = xkernel -o "x$ZFS_CONFIG" = xsrpm ], [
|
||||||
|
enable_pyzfs=no
|
||||||
|
AC_MSG_NOTICE([Disabling pyzfs for kernel/srpm config])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Python "packaging" (or, failing that, "distlib") module is required to build and install pyzfs
|
dnl # Python "packaging" (or, failing that, "distlib") module is required to build and install pyzfs
|
||||||
dnl #
|
dnl #
|
||||||
|
|||||||
+35
-36
@@ -97,23 +97,13 @@ AC_DEFUN([AX_PYTHON_DEVEL],[
|
|||||||
# Check for a version of Python >= 2.1.0
|
# Check for a version of Python >= 2.1.0
|
||||||
#
|
#
|
||||||
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
|
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
|
||||||
ac_supports_python_ver=`cat<<EOD | $PYTHON -
|
ac_supports_python_ver=`$PYTHON -c "import sys; \
|
||||||
from __future__ import print_function;
|
ver = sys.version.split ()[[0]]; \
|
||||||
import sys;
|
print (ver >= '2.1.0')"`
|
||||||
try:
|
|
||||||
from packaging import version;
|
|
||||||
except ImportError:
|
|
||||||
from distlib import version;
|
|
||||||
ver = sys.version.split ()[[0]];
|
|
||||||
(tst_cmp, tst_ver) = ">= '2.1.0'".split ();
|
|
||||||
tst_ver = tst_ver.strip ("'");
|
|
||||||
eval ("print (version.LegacyVersion (ver)"+ tst_cmp +"version.LegacyVersion (tst_ver))")
|
|
||||||
EOD`
|
|
||||||
if test "$ac_supports_python_ver" != "True"; then
|
if test "$ac_supports_python_ver" != "True"; then
|
||||||
if test -z "$PYTHON_NOVERSIONCHECK"; then
|
if test -z "$PYTHON_NOVERSIONCHECK"; then
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
m4_ifvaln([$2],[$2],[
|
AC_MSG_FAILURE([
|
||||||
AC_MSG_FAILURE([
|
|
||||||
This version of the AC@&t@_PYTHON_DEVEL macro
|
This version of the AC@&t@_PYTHON_DEVEL macro
|
||||||
doesn't work properly with versions of Python before
|
doesn't work properly with versions of Python before
|
||||||
2.1.0. You may need to re-run configure, setting the
|
2.1.0. You may need to re-run configure, setting the
|
||||||
@@ -122,7 +112,6 @@ PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
|
|||||||
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
|
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
|
||||||
to something else than an empty string.
|
to something else than an empty string.
|
||||||
])
|
])
|
||||||
])
|
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([skip at user request])
|
AC_MSG_RESULT([skip at user request])
|
||||||
fi
|
fi
|
||||||
@@ -131,37 +120,47 @@ to something else than an empty string.
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# if the macro parameter ``version'' is set, honour it
|
# If the macro parameter ``version'' is set, honour it.
|
||||||
|
# A Python shim class, VPy, is used to implement correct version comparisons via
|
||||||
|
# string expressions, since e.g. a naive textual ">= 2.7.3" won't work for
|
||||||
|
# Python 2.7.10 (the ".1" being evaluated as less than ".3").
|
||||||
#
|
#
|
||||||
if test -n "$1"; then
|
if test -n "$1"; then
|
||||||
AC_MSG_CHECKING([for a version of Python $1])
|
AC_MSG_CHECKING([for a version of Python $1])
|
||||||
# Why the strip ()? Because if we don't, version.parse
|
cat << EOF > ax_python_devel_vpy.py
|
||||||
# will, for example, report 3.10.0 >= '3.11.0'
|
class VPy:
|
||||||
ac_supports_python_ver=`cat<<EOD | $PYTHON -
|
def vtup(self, s):
|
||||||
|
return tuple(map(int, s.strip().replace("rc", ".").split(".")))
|
||||||
from __future__ import print_function;
|
def __init__(self):
|
||||||
import sys;
|
import sys
|
||||||
try:
|
self.vpy = tuple(sys.version_info)
|
||||||
from packaging import version;
|
def __eq__(self, s):
|
||||||
except ImportError:
|
return self.vpy == self.vtup(s)
|
||||||
from distlib import version;
|
def __ne__(self, s):
|
||||||
ver = sys.version.split ()[[0]];
|
return self.vpy != self.vtup(s)
|
||||||
(tst_cmp, tst_ver) = "$1".split ();
|
def __lt__(self, s):
|
||||||
tst_ver = tst_ver.strip ("'");
|
return self.vpy < self.vtup(s)
|
||||||
eval ("print (version.LegacyVersion (ver)"+ tst_cmp +"version.LegacyVersion (tst_ver))")
|
def __gt__(self, s):
|
||||||
EOD`
|
return self.vpy > self.vtup(s)
|
||||||
|
def __le__(self, s):
|
||||||
|
return self.vpy <= self.vtup(s)
|
||||||
|
def __ge__(self, s):
|
||||||
|
return self.vpy >= self.vtup(s)
|
||||||
|
EOF
|
||||||
|
ac_supports_python_ver=`$PYTHON -c "import ax_python_devel_vpy; \
|
||||||
|
ver = ax_python_devel_vpy.VPy(); \
|
||||||
|
print (ver $1)"`
|
||||||
|
rm -rf ax_python_devel_vpy*.py* __pycache__/ax_python_devel_vpy*.py*
|
||||||
if test "$ac_supports_python_ver" = "True"; then
|
if test "$ac_supports_python_ver" = "True"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
m4_ifvaln([$2],[$2],[
|
AC_MSG_ERROR([this package requires Python $1.
|
||||||
AC_MSG_ERROR([this package requires Python $1.
|
|
||||||
If you have it installed, but it isn't the default Python
|
If you have it installed, but it isn't the default Python
|
||||||
interpreter in your system path, please pass the PYTHON_VERSION
|
interpreter in your system path, please pass the PYTHON_VERSION
|
||||||
variable to configure. See ``configure --help'' for reference.
|
variable to configure. See ``configure --help'' for reference.
|
||||||
])
|
])
|
||||||
PYTHON_VERSION=""
|
PYTHON_VERSION=""
|
||||||
])
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -66,7 +66,7 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
## to do this, so we install a shim onto the path which calls the real
|
## to do this, so we install a shim onto the path which calls the real
|
||||||
## dh_shlibdeps with the required arguments.
|
## dh_shlibdeps with the required arguments.
|
||||||
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
||||||
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
echo "#!$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
||||||
echo "`which dh_shlibdeps` -- \
|
echo "`which dh_shlibdeps` -- \
|
||||||
-xlibuutil3linux -xlibnvpair3linux -xlibzfs5linux -xlibzpool5linux" \
|
-xlibuutil3linux -xlibnvpair3linux -xlibzfs5linux -xlibzpool5linux" \
|
||||||
>> $${path_prepend}/dh_shlibdeps; \
|
>> $${path_prepend}/dh_shlibdeps; \
|
||||||
@@ -74,7 +74,7 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
## Debianized packages from the auto-generated dependencies of the new debs,
|
## Debianized packages from the auto-generated dependencies of the new debs,
|
||||||
## which should NOT be mixed with the alien-generated debs created here
|
## which should NOT be mixed with the alien-generated debs created here
|
||||||
chmod +x $${path_prepend}/dh_shlibdeps; \
|
chmod +x $${path_prepend}/dh_shlibdeps; \
|
||||||
env PATH=$${path_prepend}:$${PATH} \
|
env "PATH=$${path_prepend}:$${PATH}" \
|
||||||
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
|
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
|
||||||
$$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
|
$$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
|
||||||
$$pkg8 $$pkg9 $$pkg10 || exit 1; \
|
$$pkg8 $$pkg9 $$pkg10 || exit 1; \
|
||||||
|
|||||||
+18
-1
@@ -189,6 +189,18 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
|
|||||||
.get_acl = get_acl_fn,
|
.get_acl = get_acl_fn,
|
||||||
};
|
};
|
||||||
],[])
|
],[])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_get_inode_acl], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
struct posix_acl *get_inode_acl_fn(struct inode *inode, int type,
|
||||||
|
bool rcu) { return NULL; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.get_inode_acl = get_inode_acl_fn,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
||||||
@@ -201,7 +213,12 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GET_ACL_RCU, 1, [iops->get_acl() takes rcu])
|
AC_DEFINE(HAVE_GET_ACL_RCU, 1, [iops->get_acl() takes rcu])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_ERROR([iops->get_acl()])
|
ZFS_LINUX_TEST_RESULT([inode_operations_get_inode_acl], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GET_INODE_ACL, 1, [has iops->get_inode_acl()])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([iops->get_acl() or iops->get_inode_acl()])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_ADD_DISK], [
|
|||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
], [
|
], [
|
||||||
struct gendisk *disk = NULL;
|
struct gendisk *disk = NULL;
|
||||||
int err = add_disk(disk);
|
int error __attribute__ ((unused)) = add_disk(disk);
|
||||||
err = err;
|
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 3.18 API change
|
||||||
|
dnl # Dentry aliases are in d_u struct dentry member
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY_ALIAS_D_U], [
|
||||||
|
ZFS_LINUX_TEST_SRC([dentry_alias_d_u], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/dcache.h>
|
||||||
|
#include <linux/list.h>
|
||||||
|
], [
|
||||||
|
struct inode *inode __attribute__ ((unused)) = NULL;
|
||||||
|
struct dentry *dentry __attribute__ ((unused)) = NULL;
|
||||||
|
hlist_for_each_entry(dentry, &inode->i_dentry,
|
||||||
|
d_u.d_alias) {
|
||||||
|
d_drop(dentry);
|
||||||
|
}
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_DENTRY_ALIAS_D_U], [
|
||||||
|
AC_MSG_CHECKING([whether dentry aliases are in d_u member])
|
||||||
|
ZFS_LINUX_TEST_RESULT([dentry_alias_d_u], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_DENTRY_D_U_ALIASES, 1,
|
||||||
|
[dentry aliases are in d_u member])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ dnl #
|
|||||||
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
||||||
AC_MSG_CHECKING([whether enum $2 contains $1])
|
AC_MSG_CHECKING([whether enum $2 contains $1])
|
||||||
AS_IF([AC_TRY_COMMAND(
|
AS_IF([AC_TRY_COMMAND(
|
||||||
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | egrep -qx $1)],[
|
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | grep -Eqx $1)],[
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
||||||
[enum $2 contains $1])
|
[enum $2 contains $1])
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # Grsecurity kernel API change
|
|
||||||
dnl # constified parameters of module_param_call() methods
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MODULE_PARAM_CALL_CONST], [
|
|
||||||
ZFS_LINUX_TEST_SRC([module_param_call], [
|
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/moduleparam.h>
|
|
||||||
|
|
||||||
int param_get(char *b, const struct kernel_param *kp)
|
|
||||||
{
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int param_set(const char *b, const struct kernel_param *kp)
|
|
||||||
{
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
module_param_call(p, param_set, param_get, NULL, 0644);
|
|
||||||
],[])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST], [
|
|
||||||
AC_MSG_CHECKING([whether module_param_call() is hardened])
|
|
||||||
ZFS_LINUX_TEST_RESULT([module_param_call], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(MODULE_PARAM_CALL_CONST, 1,
|
|
||||||
[hardened module_param_call])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
@@ -3,11 +3,25 @@ dnl # 3.11 API change
|
|||||||
dnl # Add support for i_op->tmpfile
|
dnl # Add support for i_op->tmpfile
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
||||||
|
dnl #
|
||||||
|
dnl # 6.1 API change
|
||||||
|
dnl # use struct file instead of struct dentry
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
int tmpfile(struct user_namespace *userns,
|
||||||
|
struct inode *inode, struct file *file,
|
||||||
|
umode_t mode) { return 0; }
|
||||||
|
static struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.tmpfile = tmpfile,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 5.11 API change
|
dnl # 5.11 API change
|
||||||
dnl # add support for userns parameter to tmpfile
|
dnl # add support for userns parameter to tmpfile
|
||||||
dnl #
|
dnl #
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_userns], [
|
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry_userns], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
int tmpfile(struct user_namespace *userns,
|
int tmpfile(struct user_namespace *userns,
|
||||||
struct inode *inode, struct dentry *dentry,
|
struct inode *inode, struct dentry *dentry,
|
||||||
@@ -17,7 +31,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
|||||||
.tmpfile = tmpfile,
|
.tmpfile = tmpfile,
|
||||||
};
|
};
|
||||||
],[])
|
],[])
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [
|
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
int tmpfile(struct inode *inode, struct dentry *dentry,
|
int tmpfile(struct inode *inode, struct dentry *dentry,
|
||||||
umode_t mode) { return 0; }
|
umode_t mode) { return 0; }
|
||||||
@@ -30,16 +44,24 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [
|
AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [
|
||||||
AC_MSG_CHECKING([whether i_op->tmpfile() exists])
|
AC_MSG_CHECKING([whether i_op->tmpfile() exists])
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_userns], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||||
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry_userns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||||
|
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
||||||
|
AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||||
|
AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_REQUIRE_API([i_op->tmpfile()], [3.11])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
+48
-9
@@ -93,6 +93,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_SETATTR_PREPARE
|
ZFS_AC_KERNEL_SRC_SETATTR_PREPARE
|
||||||
ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED
|
ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED
|
||||||
ZFS_AC_KERNEL_SRC_DENTRY
|
ZFS_AC_KERNEL_SRC_DENTRY
|
||||||
|
ZFS_AC_KERNEL_SRC_DENTRY_ALIAS_D_U
|
||||||
ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE
|
ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE
|
||||||
ZFS_AC_KERNEL_SRC_SECURITY_INODE
|
ZFS_AC_KERNEL_SRC_SECURITY_INODE
|
||||||
ZFS_AC_KERNEL_SRC_FST_MOUNT
|
ZFS_AC_KERNEL_SRC_FST_MOUNT
|
||||||
@@ -119,7 +120,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_FMODE_T
|
ZFS_AC_KERNEL_SRC_FMODE_T
|
||||||
ZFS_AC_KERNEL_SRC_KUIDGID_T
|
ZFS_AC_KERNEL_SRC_KUIDGID_T
|
||||||
ZFS_AC_KERNEL_SRC_KUID_HELPERS
|
ZFS_AC_KERNEL_SRC_KUID_HELPERS
|
||||||
ZFS_AC_KERNEL_SRC_MODULE_PARAM_CALL_CONST
|
|
||||||
ZFS_AC_KERNEL_SRC_RENAME
|
ZFS_AC_KERNEL_SRC_RENAME
|
||||||
ZFS_AC_KERNEL_SRC_CURRENT_TIME
|
ZFS_AC_KERNEL_SRC_CURRENT_TIME
|
||||||
ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES
|
ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES
|
||||||
@@ -210,6 +210,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_SETATTR_PREPARE
|
ZFS_AC_KERNEL_SETATTR_PREPARE
|
||||||
ZFS_AC_KERNEL_INSERT_INODE_LOCKED
|
ZFS_AC_KERNEL_INSERT_INODE_LOCKED
|
||||||
ZFS_AC_KERNEL_DENTRY
|
ZFS_AC_KERNEL_DENTRY
|
||||||
|
ZFS_AC_KERNEL_DENTRY_ALIAS_D_U
|
||||||
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
|
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
|
||||||
ZFS_AC_KERNEL_SECURITY_INODE
|
ZFS_AC_KERNEL_SECURITY_INODE
|
||||||
ZFS_AC_KERNEL_FST_MOUNT
|
ZFS_AC_KERNEL_FST_MOUNT
|
||||||
@@ -236,7 +237,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_FMODE_T
|
ZFS_AC_KERNEL_FMODE_T
|
||||||
ZFS_AC_KERNEL_KUIDGID_T
|
ZFS_AC_KERNEL_KUIDGID_T
|
||||||
ZFS_AC_KERNEL_KUID_HELPERS
|
ZFS_AC_KERNEL_KUID_HELPERS
|
||||||
ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST
|
|
||||||
ZFS_AC_KERNEL_RENAME
|
ZFS_AC_KERNEL_RENAME
|
||||||
ZFS_AC_KERNEL_CURRENT_TIME
|
ZFS_AC_KERNEL_CURRENT_TIME
|
||||||
ZFS_AC_KERNEL_USERNS_CAPABILITIES
|
ZFS_AC_KERNEL_USERNS_CAPABILITIES
|
||||||
@@ -404,11 +404,11 @@ AC_DEFUN([ZFS_AC_KERNEL], [
|
|||||||
utsrelease1=$kernelbuild/include/linux/version.h
|
utsrelease1=$kernelbuild/include/linux/version.h
|
||||||
utsrelease2=$kernelbuild/include/linux/utsrelease.h
|
utsrelease2=$kernelbuild/include/linux/utsrelease.h
|
||||||
utsrelease3=$kernelbuild/include/generated/utsrelease.h
|
utsrelease3=$kernelbuild/include/generated/utsrelease.h
|
||||||
AS_IF([test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1], [
|
AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [
|
||||||
utsrelease=$utsrelease1
|
utsrelease=$utsrelease1
|
||||||
], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
|
], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [
|
||||||
utsrelease=$utsrelease2
|
utsrelease=$utsrelease2
|
||||||
], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
|
], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [
|
||||||
utsrelease=$utsrelease3
|
utsrelease=$utsrelease3
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -934,8 +934,47 @@ dnl # like ZFS_LINUX_TRY_COMPILE, except the contents conftest.h are
|
|||||||
dnl # provided via the fifth parameter
|
dnl # provided via the fifth parameter
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
|
AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
|
||||||
ZFS_LINUX_COMPILE_IFELSE(
|
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
|
||||||
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], [[ZFS_META_LICENSE]])],
|
ZFS_LINUX_COMPILE_IFELSE(
|
||||||
[test -f build/conftest/conftest.ko],
|
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
|
||||||
[$3], [$4], [$5])
|
[[ZFS_META_LICENSE]])],
|
||||||
|
[test -f build/conftest/conftest.o], [$3], [$4], [$5])
|
||||||
|
], [
|
||||||
|
ZFS_LINUX_COMPILE_IFELSE(
|
||||||
|
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
|
||||||
|
[[ZFS_META_LICENSE]])],
|
||||||
|
[test -f build/conftest/conftest.ko], [$3], [$4], [$5])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # AS_VERSION_COMPARE_LE
|
||||||
|
dnl # like AS_VERSION_COMPARE_LE, but runs $3 if (and only if) $1 <= $2
|
||||||
|
dnl # AS_VERSION_COMPARE_LE (version-1, version-2, [action-if-less-or-equal], [action-if-greater])
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([AS_VERSION_COMPARE_LE], [
|
||||||
|
AS_VERSION_COMPARE([$1], [$2], [$3], [$3], [$4])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # ZFS_LINUX_REQUIRE_API
|
||||||
|
dnl # like ZFS_LINUX_TEST_ERROR, except only fails if the kernel is
|
||||||
|
dnl # at least some specified version.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_LINUX_REQUIRE_API], [
|
||||||
|
AS_VERSION_COMPARE_LE([$2], [$kernsrcver], [
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** None of the expected "$1" interfaces were detected. This
|
||||||
|
*** interface is expected for kernels version "$2" and above.
|
||||||
|
*** This may be because your kernel version is newer than what is
|
||||||
|
*** supported, or you are using a patched custom kernel with
|
||||||
|
*** incompatible modifications. Newer kernels may have incompatible
|
||||||
|
*** APIs.
|
||||||
|
***
|
||||||
|
*** ZFS Version: $ZFS_META_ALIAS
|
||||||
|
*** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX
|
||||||
|
])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
+1
-1
@@ -173,7 +173,7 @@ AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
|
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
|
||||||
AS_IF([sysctl -n kern.conftxt | fgrep -qx $'options\tINVARIANTS'],
|
AS_IF([sysctl -n kern.conftxt | grep -Fqx $'options\tINVARIANTS'],
|
||||||
[enable_invariants="yes"],
|
[enable_invariants="yes"],
|
||||||
[enable_invariants="no"])
|
[enable_invariants="no"])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ array_contains () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
|
# https://github.com/dracutdevs/dracut/pull/1711 provides a zfs_devs
|
||||||
|
# function to detect the physical devices backing zfs pools. If this
|
||||||
|
# function exists in the version of dracut this module is being called
|
||||||
|
# from, then it does not need to run.
|
||||||
|
type zfs_devs >/dev/null 2>&1 && return 1
|
||||||
|
|
||||||
local mp
|
local mp
|
||||||
local dev
|
local dev
|
||||||
local blockdevs
|
local blockdevs
|
||||||
|
|||||||
@@ -89,6 +89,16 @@ install() {
|
|||||||
"zfs-import-cache.service"; do
|
"zfs-import-cache.service"; do
|
||||||
inst_simple "${systemdsystemunitdir}/${_service}"
|
inst_simple "${systemdsystemunitdir}/${_service}"
|
||||||
systemctl -q --root "${initdir}" add-wants zfs-import.target "${_service}"
|
systemctl -q --root "${initdir}" add-wants zfs-import.target "${_service}"
|
||||||
|
|
||||||
|
# Add user-provided unit overrides
|
||||||
|
# - /etc/systemd/system/zfs-import-{scan,cache}.service
|
||||||
|
# - /etc/systemd/system/zfs-import-{scan,cache}.service.d/overrides.conf
|
||||||
|
# -H ensures they are marked host-only
|
||||||
|
# -o ensures there is no error upon absence of these files
|
||||||
|
inst_multiple -o -H \
|
||||||
|
"${systemdsystemconfdir}/${_service}" \
|
||||||
|
"${systemdsystemconfdir}/${_service}.d/"*.conf
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
for _service in \
|
for _service in \
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ ZFS_DATASET="${ZFS_DATASET:-${root}}"
|
|||||||
ZFS_POOL="${ZFS_DATASET%%/*}"
|
ZFS_POOL="${ZFS_DATASET%%/*}"
|
||||||
|
|
||||||
|
|
||||||
if ! zpool get -Ho name "${ZFS_POOL}" > /dev/null 2>&1; then
|
if ! zpool get -Ho value name "${ZFS_POOL}" > /dev/null 2>&1; then
|
||||||
info "ZFS: Importing pool ${ZFS_POOL}..."
|
info "ZFS: Importing pool ${ZFS_POOL}..."
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if ! zpool import -N ${ZPOOL_IMPORT_OPTS} "${ZFS_POOL}"; then
|
if ! zpool import -N ${ZPOOL_IMPORT_OPTS} "${ZFS_POOL}"; then
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.rollback
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS" SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "$root@${SNAPNAME:-%v}"'
|
ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "$root@${SNAPNAME:-%v}"'
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.snapshot
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
-ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS" SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
|
ExecStart=-/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|||||||
@@ -326,30 +326,26 @@ mount_fs()
|
|||||||
|
|
||||||
# Need the _original_ datasets mountpoint!
|
# Need the _original_ datasets mountpoint!
|
||||||
mountpoint=$(get_fs_value "$fs" mountpoint)
|
mountpoint=$(get_fs_value "$fs" mountpoint)
|
||||||
ZFS_CMD="mount -o zfsutil -t zfs"
|
ZFS_CMD="mount.zfs -o zfsutil"
|
||||||
if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then
|
if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then
|
||||||
# Can't use the mountpoint property. Might be one of our
|
# Can't use the mountpoint property. Might be one of our
|
||||||
# clones. Check the 'org.zol:mountpoint' property set in
|
# clones. Check the 'org.zol:mountpoint' property set in
|
||||||
# clone_snap() if that's usable.
|
# clone_snap() if that's usable.
|
||||||
mountpoint=$(get_fs_value "$fs" org.zol:mountpoint)
|
mountpoint1=$(get_fs_value "$fs" org.zol:mountpoint)
|
||||||
if [ "$mountpoint" = "legacy" ] ||
|
if [ "$mountpoint1" = "legacy" ] ||
|
||||||
[ "$mountpoint" = "none" ] ||
|
[ "$mountpoint1" = "none" ] ||
|
||||||
[ "$mountpoint" = "-" ]
|
[ "$mountpoint1" = "-" ]
|
||||||
then
|
then
|
||||||
if [ "$fs" != "${ZFS_BOOTFS}" ]; then
|
if [ "$fs" != "${ZFS_BOOTFS}" ]; then
|
||||||
# We don't have a proper mountpoint and this
|
# We don't have a proper mountpoint and this
|
||||||
# isn't the root fs.
|
# isn't the root fs.
|
||||||
return 0
|
return 0
|
||||||
else
|
|
||||||
# Last hail-mary: Hope 'rootmnt' is set!
|
|
||||||
mountpoint=""
|
|
||||||
fi
|
fi
|
||||||
fi
|
ZFS_CMD="mount.zfs"
|
||||||
|
# Last hail-mary: Hope 'rootmnt' is set!
|
||||||
# If it's not a legacy filesystem, it can only be a
|
mountpoint=""
|
||||||
# native one...
|
else
|
||||||
if [ "$mountpoint" = "legacy" ]; then
|
mountpoint="$mountpoint1"
|
||||||
ZFS_CMD="mount -t zfs"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -503,7 +499,7 @@ clone_snap()
|
|||||||
echo "Error: $ZFS_ERROR"
|
echo "Error: $ZFS_ERROR"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Failed to clone snapshot."
|
echo "Failed to clone snapshot."
|
||||||
echo "Make sure that the any problems are corrected and then make sure"
|
echo "Make sure that any problems are corrected and then make sure"
|
||||||
echo "that the dataset '$destfs' exists and is bootable."
|
echo "that the dataset '$destfs' exists and is bootable."
|
||||||
shell
|
shell
|
||||||
else
|
else
|
||||||
@@ -915,7 +911,7 @@ mountroot()
|
|||||||
echo " not specified on the kernel command line."
|
echo " not specified on the kernel command line."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Manually mount the root filesystem on $rootmnt and then exit."
|
echo "Manually mount the root filesystem on $rootmnt and then exit."
|
||||||
echo "Hint: Try: mount -o zfsutil -t zfs ${ZFS_RPOOL-rpool}/ROOT/system $rootmnt"
|
echo "Hint: Try: mount.zfs -o zfsutil ${ZFS_RPOOL-rpool}/ROOT/system $rootmnt"
|
||||||
shell
|
shell
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -496,7 +496,6 @@ zfs_key_config_get_dataset(zfs_key_config_t *config)
|
|||||||
if (zhp == NULL) {
|
if (zhp == NULL) {
|
||||||
pam_syslog(NULL, LOG_ERR, "dataset %s not found",
|
pam_syslog(NULL, LOG_ERR, "dataset %s not found",
|
||||||
config->homes_prefix);
|
config->homes_prefix);
|
||||||
zfs_close(zhp);
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,6 +507,10 @@ zfs_key_config_get_dataset(zfs_key_config_t *config)
|
|||||||
return (dsname);
|
return (dsname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config->homes_prefix == NULL) {
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
size_t len = ZFS_MAX_DATASET_NAME_LEN;
|
size_t len = ZFS_MAX_DATASET_NAME_LEN;
|
||||||
size_t total_len = strlen(config->homes_prefix) + 1
|
size_t total_len = strlen(config->homes_prefix) + 1
|
||||||
+ strlen(config->username);
|
+ strlen(config->username);
|
||||||
@@ -711,7 +714,10 @@ pam_sm_open_session(pam_handle_t *pamh, int flags,
|
|||||||
return (PAM_SUCCESS);
|
return (PAM_SUCCESS);
|
||||||
}
|
}
|
||||||
zfs_key_config_t config;
|
zfs_key_config_t config;
|
||||||
zfs_key_config_load(pamh, &config, argc, argv);
|
if (zfs_key_config_load(pamh, &config, argc, argv) != 0) {
|
||||||
|
return (PAM_SESSION_ERR);
|
||||||
|
}
|
||||||
|
|
||||||
if (config.uid < 1000) {
|
if (config.uid < 1000) {
|
||||||
zfs_key_config_free(&config);
|
zfs_key_config_free(&config);
|
||||||
return (PAM_SUCCESS);
|
return (PAM_SUCCESS);
|
||||||
@@ -765,7 +771,9 @@ pam_sm_close_session(pam_handle_t *pamh, int flags,
|
|||||||
return (PAM_SUCCESS);
|
return (PAM_SUCCESS);
|
||||||
}
|
}
|
||||||
zfs_key_config_t config;
|
zfs_key_config_t config;
|
||||||
zfs_key_config_load(pamh, &config, argc, argv);
|
if (zfs_key_config_load(pamh, &config, argc, argv) != 0) {
|
||||||
|
return (PAM_SESSION_ERR);
|
||||||
|
}
|
||||||
if (config.uid < 1000) {
|
if (config.uid < 1000) {
|
||||||
zfs_key_config_free(&config);
|
zfs_key_config_free(&config);
|
||||||
return (PAM_SUCCESS);
|
return (PAM_SUCCESS);
|
||||||
|
|||||||
@@ -22,3 +22,4 @@ SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA)
|
|||||||
install-data-hook:
|
install-data-hook:
|
||||||
$(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
|
$(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
|
||||||
ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service"
|
ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service"
|
||||||
|
ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-load-key.service"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ DefaultDependencies=no
|
|||||||
Requires=systemd-udev-settle.service
|
Requires=systemd-udev-settle.service
|
||||||
After=systemd-udev-settle.service
|
After=systemd-udev-settle.service
|
||||||
After=cryptsetup.target
|
After=cryptsetup.target
|
||||||
After=multipathd.target
|
After=multipathd.service
|
||||||
After=systemd-remount-fs.service
|
After=systemd-remount-fs.service
|
||||||
Before=zfs-import.target
|
Before=zfs-import.target
|
||||||
ConditionFileNotEmpty=@sysconfdir@/zfs/zpool.cache
|
ConditionFileNotEmpty=@sysconfdir@/zfs/zpool.cache
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ DefaultDependencies=no
|
|||||||
Requires=systemd-udev-settle.service
|
Requires=systemd-udev-settle.service
|
||||||
After=systemd-udev-settle.service
|
After=systemd-udev-settle.service
|
||||||
After=cryptsetup.target
|
After=cryptsetup.target
|
||||||
After=multipathd.target
|
After=multipathd.service
|
||||||
Before=zfs-import.target
|
Before=zfs-import.target
|
||||||
ConditionFileNotEmpty=!@sysconfdir@/zfs/zpool.cache
|
ConditionFileNotEmpty=!@sysconfdir@/zfs/zpool.cache
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@sbindir@/zed -F
|
ExecStart=@sbindir@/zed -F
|
||||||
Restart=on-abort
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
Alias=zed.service
|
Alias=zed.service
|
||||||
|
|||||||
+6
-5
@@ -150,6 +150,7 @@ typedef enum zfs_error {
|
|||||||
EZFS_NO_RESILVER_DEFER, /* pool doesn't support resilver_defer */
|
EZFS_NO_RESILVER_DEFER, /* pool doesn't support resilver_defer */
|
||||||
EZFS_EXPORT_IN_PROGRESS, /* currently exporting the pool */
|
EZFS_EXPORT_IN_PROGRESS, /* currently exporting the pool */
|
||||||
EZFS_REBUILDING, /* resilvering (sequential reconstrution) */
|
EZFS_REBUILDING, /* resilvering (sequential reconstrution) */
|
||||||
|
EZFS_CKSUM, /* insufficient replicas */
|
||||||
EZFS_UNKNOWN
|
EZFS_UNKNOWN
|
||||||
} zfs_error_t;
|
} zfs_error_t;
|
||||||
|
|
||||||
@@ -257,10 +258,10 @@ extern int zpool_add(zpool_handle_t *, nvlist_t *);
|
|||||||
|
|
||||||
typedef struct splitflags {
|
typedef struct splitflags {
|
||||||
/* do not split, but return the config that would be split off */
|
/* do not split, but return the config that would be split off */
|
||||||
int dryrun : 1;
|
unsigned int dryrun : 1;
|
||||||
|
|
||||||
/* after splitting, import the pool */
|
/* after splitting, import the pool */
|
||||||
int import : 1;
|
unsigned int import : 1;
|
||||||
int name_flags;
|
int name_flags;
|
||||||
} splitflags_t;
|
} splitflags_t;
|
||||||
|
|
||||||
@@ -649,13 +650,13 @@ extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t);
|
|||||||
|
|
||||||
typedef struct renameflags {
|
typedef struct renameflags {
|
||||||
/* recursive rename */
|
/* recursive rename */
|
||||||
int recursive : 1;
|
unsigned int recursive : 1;
|
||||||
|
|
||||||
/* don't unmount file systems */
|
/* don't unmount file systems */
|
||||||
int nounmount : 1;
|
unsigned int nounmount : 1;
|
||||||
|
|
||||||
/* force unmount file systems */
|
/* force unmount file systems */
|
||||||
int forceunmount : 1;
|
unsigned int forceunmount : 1;
|
||||||
} renameflags_t;
|
} renameflags_t;
|
||||||
|
|
||||||
extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t);
|
extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t);
|
||||||
|
|||||||
+4
-2
@@ -151,13 +151,15 @@ int zfs_ioctl_fd(int fd, unsigned long request, struct zfs_cmd *zc);
|
|||||||
* List of colors to use
|
* List of colors to use
|
||||||
*/
|
*/
|
||||||
#define ANSI_RED "\033[0;31m"
|
#define ANSI_RED "\033[0;31m"
|
||||||
|
#define ANSI_GREEN "\033[0;32m"
|
||||||
#define ANSI_YELLOW "\033[0;33m"
|
#define ANSI_YELLOW "\033[0;33m"
|
||||||
|
#define ANSI_BLUE "\033[0;34m"
|
||||||
#define ANSI_RESET "\033[0m"
|
#define ANSI_RESET "\033[0m"
|
||||||
#define ANSI_BOLD "\033[1m"
|
#define ANSI_BOLD "\033[1m"
|
||||||
|
|
||||||
void color_start(char *color);
|
void color_start(const char *color);
|
||||||
void color_end(void);
|
void color_end(void);
|
||||||
int printf_color(char *color, char *format, ...);
|
int printf_color(const char *color, char *format, ...);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These functions are used by the ZFS libraries and cmd/zpool code, but are
|
* These functions are used by the ZFS libraries and cmd/zpool code, but are
|
||||||
|
|||||||
@@ -83,7 +83,6 @@
|
|||||||
#define __printf(a, b) __printflike(a, b)
|
#define __printf(a, b) __printflike(a, b)
|
||||||
|
|
||||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
#define barrier() __asm__ __volatile__("": : :"memory")
|
||||||
#define smp_rmb() rmb()
|
|
||||||
#define ___PASTE(a, b) a##b
|
#define ___PASTE(a, b) a##b
|
||||||
#define __PASTE(a, b) ___PASTE(a, b)
|
#define __PASTE(a, b) ___PASTE(a, b)
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ extern uint64_t atomic_cas_64(volatile uint64_t *target, uint64_t cmp,
|
|||||||
uint64_t newval);
|
uint64_t newval);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define membar_producer atomic_thread_fence_rel
|
#define membar_consumer() atomic_thread_fence_acq()
|
||||||
|
#define membar_producer() atomic_thread_fence_rel()
|
||||||
|
|
||||||
static __inline uint32_t
|
static __inline uint32_t
|
||||||
atomic_add_32_nv(volatile uint32_t *target, int32_t delta)
|
atomic_add_32_nv(volatile uint32_t *target, int32_t delta)
|
||||||
|
|||||||
@@ -95,9 +95,11 @@ vn_flush_cached_data(vnode_t *vp, boolean_t sync)
|
|||||||
if (vp->v_object->flags & OBJ_MIGHTBEDIRTY) {
|
if (vp->v_object->flags & OBJ_MIGHTBEDIRTY) {
|
||||||
#endif
|
#endif
|
||||||
int flags = sync ? OBJPC_SYNC : 0;
|
int flags = sync ? OBJPC_SYNC : 0;
|
||||||
|
vn_lock(vp, LK_SHARED | LK_RETRY);
|
||||||
zfs_vmobject_wlock(vp->v_object);
|
zfs_vmobject_wlock(vp->v_object);
|
||||||
vm_object_page_clean(vp->v_object, 0, 0, flags);
|
vm_object_page_clean(vp->v_object, 0, 0, flags);
|
||||||
zfs_vmobject_wunlock(vp->v_object);
|
zfs_vmobject_wunlock(vp->v_object);
|
||||||
|
VOP_UNLOCK(vp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -357,7 +357,11 @@ vdev_lookup_bdev(const char *path, dev_t *dev)
|
|||||||
static inline void
|
static inline void
|
||||||
bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_BIO_BI_OPF)
|
||||||
|
bio->bi_opf = rw | flags;
|
||||||
|
#else
|
||||||
bio->bi_rw |= rw | flags;
|
bio->bi_rw |= rw | flags;
|
||||||
|
#endif /* HAVE_BIO_BI_OPF */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,10 @@
|
|||||||
#define d_make_root(inode) d_alloc_root(inode)
|
#define d_make_root(inode) d_alloc_root(inode)
|
||||||
#endif /* HAVE_D_MAKE_ROOT */
|
#endif /* HAVE_D_MAKE_ROOT */
|
||||||
|
|
||||||
|
#ifdef HAVE_DENTRY_D_U_ALIASES
|
||||||
|
#define d_alias d_u.d_alias
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2.6.30 API change,
|
* 2.6.30 API change,
|
||||||
* The const keyword was added to the 'struct dentry_operations' in
|
* The const keyword was added to the 'struct dentry_operations' in
|
||||||
@@ -61,4 +65,21 @@ d_clear_d_op(struct dentry *dentry)
|
|||||||
DCACHE_OP_REVALIDATE | DCACHE_OP_DELETE);
|
DCACHE_OP_REVALIDATE | DCACHE_OP_DELETE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Walk and invalidate all dentry aliases of an inode
|
||||||
|
* unless it's a mountpoint
|
||||||
|
*/
|
||||||
|
static inline void
|
||||||
|
zpl_d_drop_aliases(struct inode *inode)
|
||||||
|
{
|
||||||
|
struct dentry *dentry;
|
||||||
|
spin_lock(&inode->i_lock);
|
||||||
|
hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
|
||||||
|
if (!IS_ROOT(dentry) && !d_mountpoint(dentry) &&
|
||||||
|
(dentry->d_inode == inode)) {
|
||||||
|
d_drop(dentry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spin_unlock(&inode->i_lock);
|
||||||
|
}
|
||||||
#endif /* _ZFS_DCACHE_H */
|
#endif /* _ZFS_DCACHE_H */
|
||||||
|
|||||||
@@ -30,12 +30,16 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/moduleparam.h>
|
#include <linux/moduleparam.h>
|
||||||
|
|
||||||
/* Grsecurity kernel API change */
|
/*
|
||||||
#ifdef MODULE_PARAM_CALL_CONST
|
* Despite constifying struct kernel_param_ops, some older kernels define a
|
||||||
|
* `__check_old_set_param()` function in their headers that checks for a
|
||||||
|
* non-constified `->set()`. This has long been fixed in Linux mainline, but
|
||||||
|
* since we support older kernels, we workaround it by using a preprocessor
|
||||||
|
* definition to disable it.
|
||||||
|
*/
|
||||||
|
#define __check_old_set_param(_) (0)
|
||||||
|
|
||||||
typedef const struct kernel_param zfs_kernel_param_t;
|
typedef const struct kernel_param zfs_kernel_param_t;
|
||||||
#else
|
|
||||||
typedef struct kernel_param zfs_kernel_param_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ZMOD_RW 0644
|
#define ZMOD_RW 0644
|
||||||
#define ZMOD_RD 0444
|
#define ZMOD_RD 0444
|
||||||
|
|||||||
@@ -44,7 +44,9 @@
|
|||||||
#define zfs_totalhigh_pages totalhigh_pages
|
#define zfs_totalhigh_pages totalhigh_pages
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define membar_consumer() smp_rmb()
|
||||||
#define membar_producer() smp_wmb()
|
#define membar_producer() smp_wmb()
|
||||||
|
|
||||||
#define physmem zfs_totalram_pages
|
#define physmem zfs_totalram_pages
|
||||||
|
|
||||||
#define xcopyin(from, to, size) copy_from_user(to, from, size)
|
#define xcopyin(from, to, size) copy_from_user(to, from, size)
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
|
|||||||
__field(boolean_t, z_is_sa)
|
__field(boolean_t, z_is_sa)
|
||||||
__field(boolean_t, z_is_mapped)
|
__field(boolean_t, z_is_mapped)
|
||||||
__field(boolean_t, z_is_ctldir)
|
__field(boolean_t, z_is_ctldir)
|
||||||
__field(boolean_t, z_is_stale)
|
|
||||||
|
|
||||||
__field(uint32_t, i_uid)
|
__field(uint32_t, i_uid)
|
||||||
__field(uint32_t, i_gid)
|
__field(uint32_t, i_gid)
|
||||||
@@ -95,7 +94,6 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
|
|||||||
__entry->z_is_sa = zn->z_is_sa;
|
__entry->z_is_sa = zn->z_is_sa;
|
||||||
__entry->z_is_mapped = zn->z_is_mapped;
|
__entry->z_is_mapped = zn->z_is_mapped;
|
||||||
__entry->z_is_ctldir = zn->z_is_ctldir;
|
__entry->z_is_ctldir = zn->z_is_ctldir;
|
||||||
__entry->z_is_stale = zn->z_is_stale;
|
|
||||||
|
|
||||||
__entry->i_uid = KUID_TO_SUID(ZTOI(zn)->i_uid);
|
__entry->i_uid = KUID_TO_SUID(ZTOI(zn)->i_uid);
|
||||||
__entry->i_gid = KGID_TO_SGID(ZTOI(zn)->i_gid);
|
__entry->i_gid = KGID_TO_SGID(ZTOI(zn)->i_gid);
|
||||||
@@ -117,7 +115,7 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
|
|||||||
"zn_prefetch %u blksz %u seq %u "
|
"zn_prefetch %u blksz %u seq %u "
|
||||||
"mapcnt %llu size %llu pflags %llu "
|
"mapcnt %llu size %llu pflags %llu "
|
||||||
"sync_cnt %u mode 0x%x is_sa %d "
|
"sync_cnt %u mode 0x%x is_sa %d "
|
||||||
"is_mapped %d is_ctldir %d is_stale %d inode { "
|
"is_mapped %d is_ctldir %d inode { "
|
||||||
"uid %u gid %u ino %lu nlink %u size %lli "
|
"uid %u gid %u ino %lu nlink %u size %lli "
|
||||||
"blkbits %u bytes %u mode 0x%x generation %x } } "
|
"blkbits %u bytes %u mode 0x%x generation %x } } "
|
||||||
"ace { type %u flags %u access_mask %u } mask_matched %u",
|
"ace { type %u flags %u access_mask %u } mask_matched %u",
|
||||||
@@ -126,7 +124,7 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
|
|||||||
__entry->z_seq, __entry->z_mapcnt, __entry->z_size,
|
__entry->z_seq, __entry->z_mapcnt, __entry->z_size,
|
||||||
__entry->z_pflags, __entry->z_sync_cnt, __entry->z_mode,
|
__entry->z_pflags, __entry->z_sync_cnt, __entry->z_mode,
|
||||||
__entry->z_is_sa, __entry->z_is_mapped,
|
__entry->z_is_sa, __entry->z_is_mapped,
|
||||||
__entry->z_is_ctldir, __entry->z_is_stale, __entry->i_uid,
|
__entry->z_is_ctldir, __entry->i_uid,
|
||||||
__entry->i_gid, __entry->i_ino, __entry->i_nlink,
|
__entry->i_gid, __entry->i_ino, __entry->i_nlink,
|
||||||
__entry->i_size, __entry->i_blkbits,
|
__entry->i_size, __entry->i_blkbits,
|
||||||
__entry->i_bytes, __entry->i_mode, __entry->i_generation,
|
__entry->i_bytes, __entry->i_mode, __entry->i_generation,
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ extern const struct inode_operations zpl_inode_operations;
|
|||||||
extern const struct inode_operations zpl_dir_inode_operations;
|
extern const struct inode_operations zpl_dir_inode_operations;
|
||||||
extern const struct inode_operations zpl_symlink_inode_operations;
|
extern const struct inode_operations zpl_symlink_inode_operations;
|
||||||
extern const struct inode_operations zpl_special_inode_operations;
|
extern const struct inode_operations zpl_special_inode_operations;
|
||||||
extern dentry_operations_t zpl_dentry_operations;
|
|
||||||
|
/* zpl_file.c */
|
||||||
extern const struct address_space_operations zpl_address_space_operations;
|
extern const struct address_space_operations zpl_address_space_operations;
|
||||||
extern const struct file_operations zpl_file_operations;
|
extern const struct file_operations zpl_file_operations;
|
||||||
extern const struct file_operations zpl_dir_file_operations;
|
extern const struct file_operations zpl_dir_file_operations;
|
||||||
@@ -70,7 +71,7 @@ extern int zpl_set_acl(struct user_namespace *userns, struct inode *ip,
|
|||||||
extern int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type);
|
extern int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type);
|
||||||
#endif /* HAVE_SET_ACL_USERNS */
|
#endif /* HAVE_SET_ACL_USERNS */
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
#if defined(HAVE_GET_ACL_RCU)
|
#if defined(HAVE_GET_ACL_RCU) || defined(HAVE_GET_INODE_ACL)
|
||||||
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type, bool rcu);
|
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type, bool rcu);
|
||||||
#elif defined(HAVE_GET_ACL)
|
#elif defined(HAVE_GET_ACL)
|
||||||
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type);
|
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
|
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
|
||||||
* Copyright 2013 Saso Kiselkov. All rights reserved.
|
* Copyright 2013 Saso Kiselkov. All rights reserved.
|
||||||
* Copyright (c) 2017, Intel Corporation.
|
* Copyright (c) 2017, Intel Corporation.
|
||||||
|
* Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Portions Copyright 2010 Robert Milkowski */
|
/* Portions Copyright 2010 Robert Milkowski */
|
||||||
@@ -142,6 +143,12 @@ typedef enum dmu_object_byteswap {
|
|||||||
#define DMU_OT_IS_DDT(ot) \
|
#define DMU_OT_IS_DDT(ot) \
|
||||||
((ot) == DMU_OT_DDT_ZAP)
|
((ot) == DMU_OT_DDT_ZAP)
|
||||||
|
|
||||||
|
#define DMU_OT_IS_CRITICAL(ot) \
|
||||||
|
(DMU_OT_IS_METADATA(ot) && \
|
||||||
|
(ot) != DMU_OT_DNODE && \
|
||||||
|
(ot) != DMU_OT_DIRECTORY_CONTENTS && \
|
||||||
|
(ot) != DMU_OT_SA)
|
||||||
|
|
||||||
/* Note: ztest uses DMU_OT_UINT64_OTHER as a proxy for file blocks */
|
/* Note: ztest uses DMU_OT_UINT64_OTHER as a proxy for file blocks */
|
||||||
#define DMU_OT_IS_FILE(ot) \
|
#define DMU_OT_IS_FILE(ot) \
|
||||||
((ot) == DMU_OT_PLAIN_FILE_CONTENTS || (ot) == DMU_OT_UINT64_OTHER)
|
((ot) == DMU_OT_PLAIN_FILE_CONTENTS || (ot) == DMU_OT_UINT64_OTHER)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
* Copyright (c) 2019 Datto Inc.
|
* Copyright (c) 2019 Datto Inc.
|
||||||
* Portions Copyright 2010 Robert Milkowski
|
* Portions Copyright 2010 Robert Milkowski
|
||||||
* Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
* Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
|
||||||
|
* Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SYS_FS_ZFS_H
|
#ifndef _SYS_FS_ZFS_H
|
||||||
@@ -423,7 +424,9 @@ typedef enum {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ZFS_REDUNDANT_METADATA_ALL,
|
ZFS_REDUNDANT_METADATA_ALL,
|
||||||
ZFS_REDUNDANT_METADATA_MOST
|
ZFS_REDUNDANT_METADATA_MOST,
|
||||||
|
ZFS_REDUNDANT_METADATA_SOME,
|
||||||
|
ZFS_REDUNDANT_METADATA_NONE
|
||||||
} zfs_redundant_metadata_type_t;
|
} zfs_redundant_metadata_type_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ typedef struct znode {
|
|||||||
boolean_t z_is_sa; /* are we native sa? */
|
boolean_t z_is_sa; /* are we native sa? */
|
||||||
boolean_t z_is_mapped; /* are we mmap'ed */
|
boolean_t z_is_mapped; /* are we mmap'ed */
|
||||||
boolean_t z_is_ctldir; /* are we .zfs entry */
|
boolean_t z_is_ctldir; /* are we .zfs entry */
|
||||||
boolean_t z_is_stale; /* are we stale due to rollback? */
|
|
||||||
boolean_t z_suspended; /* extra ref from a suspend? */
|
boolean_t z_suspended; /* extra ref from a suspend? */
|
||||||
uint_t z_blksz; /* block size in bytes */
|
uint_t z_blksz; /* block size in bytes */
|
||||||
uint_t z_seq; /* modification sequence number */
|
uint_t z_seq; /* modification sequence number */
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include <zone.h>
|
#include <zone.h>
|
||||||
|
|
||||||
zoneid_t
|
zoneid_t
|
||||||
getzoneid()
|
getzoneid(void)
|
||||||
{
|
{
|
||||||
return (GLOBAL_ZONEID);
|
return (GLOBAL_ZONEID);
|
||||||
}
|
}
|
||||||
|
|||||||
+66
-49
@@ -45,16 +45,21 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sys/zfs_ioctl.h>
|
#include <sys/zfs_ioctl.h>
|
||||||
#include <libzfs.h>
|
#include <libzfs.h>
|
||||||
|
#include <libzutil.h>
|
||||||
#include "libzfs_impl.h"
|
#include "libzfs_impl.h"
|
||||||
|
|
||||||
#define ZDIFF_SNAPDIR "/.zfs/snapshot/"
|
#define ZDIFF_SNAPDIR "/.zfs/snapshot/"
|
||||||
#define ZDIFF_PREFIX "zfs-diff-%d"
|
#define ZDIFF_PREFIX "zfs-diff-%d"
|
||||||
|
|
||||||
#define ZDIFF_ADDED '+'
|
#define ZDIFF_ADDED '+'
|
||||||
#define ZDIFF_MODIFIED 'M'
|
#define ZDIFF_MODIFIED "M"
|
||||||
#define ZDIFF_REMOVED '-'
|
#define ZDIFF_REMOVED '-'
|
||||||
#define ZDIFF_RENAMED 'R'
|
#define ZDIFF_RENAMED "R"
|
||||||
|
|
||||||
|
#define ZDIFF_ADDED_COLOR ANSI_GREEN
|
||||||
|
#define ZDIFF_MODIFIED_COLOR ANSI_YELLOW
|
||||||
|
#define ZDIFF_REMOVED_COLOR ANSI_RED
|
||||||
|
#define ZDIFF_RENAMED_COLOR ANSI_BLUE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given a {dsname, object id}, get the object path
|
* Given a {dsname, object id}, get the object path
|
||||||
@@ -129,48 +134,54 @@ stream_bytes(FILE *fp, const char *string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*
|
||||||
print_what(FILE *fp, mode_t what)
|
* Takes the type of change (like `print_file`), outputs the appropriate color
|
||||||
|
*/
|
||||||
|
static const char *
|
||||||
|
type_to_color(char type)
|
||||||
{
|
{
|
||||||
char symbol;
|
if (type == '+')
|
||||||
|
return (ZDIFF_ADDED_COLOR);
|
||||||
|
else if (type == '-')
|
||||||
|
return (ZDIFF_REMOVED_COLOR);
|
||||||
|
else if (type == 'M')
|
||||||
|
return (ZDIFF_MODIFIED_COLOR);
|
||||||
|
else if (type == 'R')
|
||||||
|
return (ZDIFF_RENAMED_COLOR);
|
||||||
|
else
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static char
|
||||||
|
get_what(mode_t what)
|
||||||
|
{
|
||||||
switch (what & S_IFMT) {
|
switch (what & S_IFMT) {
|
||||||
case S_IFBLK:
|
case S_IFBLK:
|
||||||
symbol = 'B';
|
return ('B');
|
||||||
break;
|
|
||||||
case S_IFCHR:
|
case S_IFCHR:
|
||||||
symbol = 'C';
|
return ('C');
|
||||||
break;
|
|
||||||
case S_IFDIR:
|
case S_IFDIR:
|
||||||
symbol = '/';
|
return ('/');
|
||||||
break;
|
|
||||||
#ifdef S_IFDOOR
|
#ifdef S_IFDOOR
|
||||||
case S_IFDOOR:
|
case S_IFDOOR:
|
||||||
symbol = '>';
|
return ('>');
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
case S_IFIFO:
|
case S_IFIFO:
|
||||||
symbol = '|';
|
return ('|');
|
||||||
break;
|
|
||||||
case S_IFLNK:
|
case S_IFLNK:
|
||||||
symbol = '@';
|
return ('@');
|
||||||
break;
|
|
||||||
#ifdef S_IFPORT
|
#ifdef S_IFPORT
|
||||||
case S_IFPORT:
|
case S_IFPORT:
|
||||||
symbol = 'P';
|
return ('P');
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
case S_IFSOCK:
|
case S_IFSOCK:
|
||||||
symbol = '=';
|
return ('=');
|
||||||
break;
|
|
||||||
case S_IFREG:
|
case S_IFREG:
|
||||||
symbol = 'F';
|
return ('F');
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
symbol = '?';
|
return ('?');
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
(void) fprintf(fp, "%c", symbol);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -189,57 +200,63 @@ static void
|
|||||||
print_rename(FILE *fp, differ_info_t *di, const char *old, const char *new,
|
print_rename(FILE *fp, differ_info_t *di, const char *old, const char *new,
|
||||||
zfs_stat_t *isb)
|
zfs_stat_t *isb)
|
||||||
{
|
{
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_start(ZDIFF_RENAMED_COLOR);
|
||||||
if (di->timestamped)
|
if (di->timestamped)
|
||||||
(void) fprintf(fp, "%10lld.%09lld\t",
|
(void) fprintf(fp, "%10lld.%09lld\t",
|
||||||
(longlong_t)isb->zs_ctime[0],
|
(longlong_t)isb->zs_ctime[0],
|
||||||
(longlong_t)isb->zs_ctime[1]);
|
(longlong_t)isb->zs_ctime[1]);
|
||||||
(void) fprintf(fp, "%c\t", ZDIFF_RENAMED);
|
(void) fputs(ZDIFF_RENAMED "\t", fp);
|
||||||
if (di->classify) {
|
if (di->classify)
|
||||||
print_what(fp, isb->zs_mode);
|
(void) fprintf(fp, "%c\t", get_what(isb->zs_mode));
|
||||||
(void) fprintf(fp, "\t");
|
|
||||||
}
|
|
||||||
print_cmn(fp, di, old);
|
print_cmn(fp, di, old);
|
||||||
if (di->scripted)
|
(void) fputs(di->scripted ? "\t" : " -> ", fp);
|
||||||
(void) fprintf(fp, "\t");
|
|
||||||
else
|
|
||||||
(void) fprintf(fp, " -> ");
|
|
||||||
print_cmn(fp, di, new);
|
print_cmn(fp, di, new);
|
||||||
(void) fprintf(fp, "\n");
|
(void) fputc('\n', fp);
|
||||||
|
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_link_change(FILE *fp, differ_info_t *di, int delta, const char *file,
|
print_link_change(FILE *fp, differ_info_t *di, int delta, const char *file,
|
||||||
zfs_stat_t *isb)
|
zfs_stat_t *isb)
|
||||||
{
|
{
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_start(ZDIFF_MODIFIED_COLOR);
|
||||||
|
|
||||||
if (di->timestamped)
|
if (di->timestamped)
|
||||||
(void) fprintf(fp, "%10lld.%09lld\t",
|
(void) fprintf(fp, "%10lld.%09lld\t",
|
||||||
(longlong_t)isb->zs_ctime[0],
|
(longlong_t)isb->zs_ctime[0],
|
||||||
(longlong_t)isb->zs_ctime[1]);
|
(longlong_t)isb->zs_ctime[1]);
|
||||||
(void) fprintf(fp, "%c\t", ZDIFF_MODIFIED);
|
(void) fputs(ZDIFF_MODIFIED "\t", fp);
|
||||||
if (di->classify) {
|
if (di->classify)
|
||||||
print_what(fp, isb->zs_mode);
|
(void) fprintf(fp, "%c\t", get_what(isb->zs_mode));
|
||||||
(void) fprintf(fp, "\t");
|
|
||||||
}
|
|
||||||
print_cmn(fp, di, file);
|
print_cmn(fp, di, file);
|
||||||
(void) fprintf(fp, "\t(%+d)", delta);
|
(void) fprintf(fp, "\t(%+d)\n", delta);
|
||||||
(void) fprintf(fp, "\n");
|
if (isatty(fileno(fp)))
|
||||||
|
color_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_file(FILE *fp, differ_info_t *di, char type, const char *file,
|
print_file(FILE *fp, differ_info_t *di, char type, const char *file,
|
||||||
zfs_stat_t *isb)
|
zfs_stat_t *isb)
|
||||||
{
|
{
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_start(type_to_color(type));
|
||||||
|
|
||||||
if (di->timestamped)
|
if (di->timestamped)
|
||||||
(void) fprintf(fp, "%10lld.%09lld\t",
|
(void) fprintf(fp, "%10lld.%09lld\t",
|
||||||
(longlong_t)isb->zs_ctime[0],
|
(longlong_t)isb->zs_ctime[0],
|
||||||
(longlong_t)isb->zs_ctime[1]);
|
(longlong_t)isb->zs_ctime[1]);
|
||||||
(void) fprintf(fp, "%c\t", type);
|
(void) fprintf(fp, "%c\t", type);
|
||||||
if (di->classify) {
|
if (di->classify)
|
||||||
print_what(fp, isb->zs_mode);
|
(void) fprintf(fp, "%c\t", get_what(isb->zs_mode));
|
||||||
(void) fprintf(fp, "\t");
|
|
||||||
}
|
|
||||||
print_cmn(fp, di, file);
|
print_cmn(fp, di, file);
|
||||||
(void) fprintf(fp, "\n");
|
(void) fputc('\n', fp);
|
||||||
|
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -332,7 +349,7 @@ write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
|
|||||||
print_link_change(fp, di, change,
|
print_link_change(fp, di, change,
|
||||||
change > 0 ? fobjname : tobjname, &tsb);
|
change > 0 ? fobjname : tobjname, &tsb);
|
||||||
} else if (strcmp(fobjname, tobjname) == 0) {
|
} else if (strcmp(fobjname, tobjname) == 0) {
|
||||||
print_file(fp, di, ZDIFF_MODIFIED, fobjname, &tsb);
|
print_file(fp, di, *ZDIFF_MODIFIED, fobjname, &tsb);
|
||||||
} else {
|
} else {
|
||||||
print_rename(fp, di, fobjname, tobjname, &tsb);
|
print_rename(fp, di, fobjname, tobjname, &tsb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,8 @@
|
|||||||
static boolean_t zpool_vdev_is_interior(const char *name);
|
static boolean_t zpool_vdev_is_interior(const char *name);
|
||||||
|
|
||||||
typedef struct prop_flags {
|
typedef struct prop_flags {
|
||||||
int create:1; /* Validate property on creation */
|
unsigned int create:1; /* Validate property on creation */
|
||||||
int import:1; /* Validate property on import */
|
unsigned int import:1; /* Validate property on import */
|
||||||
} prop_flags_t;
|
} prop_flags_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -4788,8 +4788,8 @@ zpool_load_compat(const char *compat, boolean_t *features, char *report,
|
|||||||
for (uint_t i = 0; i < SPA_FEATURES; i++)
|
for (uint_t i = 0; i < SPA_FEATURES; i++)
|
||||||
features[i] = B_TRUE;
|
features[i] = B_TRUE;
|
||||||
|
|
||||||
char err_badfile[1024] = "";
|
char err_badfile[ZFS_MAXPROPLEN] = "";
|
||||||
char err_badtoken[1024] = "";
|
char err_badtoken[ZFS_MAXPROPLEN] = "";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We ignore errors from the directory open()
|
* We ignore errors from the directory open()
|
||||||
|
|||||||
@@ -3966,6 +3966,15 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For plain replicated send, we can ignore encryption
|
||||||
|
* properties other than first stream
|
||||||
|
*/
|
||||||
|
if ((zfs_prop_encryption_key_param(prop) || prop ==
|
||||||
|
ZFS_PROP_ENCRYPTION) && !newfs && recursive && !raw) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* incremental streams can only exclude encryption properties */
|
/* incremental streams can only exclude encryption properties */
|
||||||
if ((zfs_prop_encryption_key_param(prop) ||
|
if ((zfs_prop_encryption_key_param(prop) ||
|
||||||
prop == ZFS_PROP_ENCRYPTION) && !newfs &&
|
prop == ZFS_PROP_ENCRYPTION) && !newfs &&
|
||||||
@@ -4013,8 +4022,8 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type,
|
|||||||
* properties: if we're asked to exclude this kind of
|
* properties: if we're asked to exclude this kind of
|
||||||
* values we remove them from "recvprops" input nvlist.
|
* values we remove them from "recvprops" input nvlist.
|
||||||
*/
|
*/
|
||||||
if (!zfs_prop_inheritable(prop) &&
|
if (!zfs_prop_user(name) && /* can be inherited too */
|
||||||
!zfs_prop_user(name) && /* can be inherited too */
|
!zfs_prop_inheritable(prop) &&
|
||||||
nvlist_exists(recvprops, name))
|
nvlist_exists(recvprops, name))
|
||||||
fnvlist_remove(recvprops, name);
|
fnvlist_remove(recvprops, name);
|
||||||
else
|
else
|
||||||
@@ -4065,7 +4074,8 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type,
|
|||||||
if (cp != NULL)
|
if (cp != NULL)
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
|
|
||||||
if (!raw && zfs_crypto_create(hdl, namebuf, voprops, NULL,
|
if (!raw && !(!newfs && recursive) &&
|
||||||
|
zfs_crypto_create(hdl, namebuf, voprops, NULL,
|
||||||
B_FALSE, wkeydata_out, wkeylen_out) != 0) {
|
B_FALSE, wkeydata_out, wkeylen_out) != 0) {
|
||||||
fnvlist_free(voprops);
|
fnvlist_free(voprops);
|
||||||
ret = zfs_error(hdl, EZFS_CRYPTOFAILED, errbuf);
|
ret = zfs_error(hdl, EZFS_CRYPTOFAILED, errbuf);
|
||||||
|
|||||||
@@ -170,6 +170,8 @@ libzfs_error_description(libzfs_handle_t *hdl)
|
|||||||
return (dgettext(TEXT_DOMAIN, "I/O error"));
|
return (dgettext(TEXT_DOMAIN, "I/O error"));
|
||||||
case EZFS_INTR:
|
case EZFS_INTR:
|
||||||
return (dgettext(TEXT_DOMAIN, "signal received"));
|
return (dgettext(TEXT_DOMAIN, "signal received"));
|
||||||
|
case EZFS_CKSUM:
|
||||||
|
return (dgettext(TEXT_DOMAIN, "insufficient replicas"));
|
||||||
case EZFS_ISSPARE:
|
case EZFS_ISSPARE:
|
||||||
return (dgettext(TEXT_DOMAIN, "device is reserved as a hot "
|
return (dgettext(TEXT_DOMAIN, "device is reserved as a hot "
|
||||||
"spare"));
|
"spare"));
|
||||||
@@ -392,6 +394,10 @@ zfs_common_error(libzfs_handle_t *hdl, int error, const char *fmt,
|
|||||||
case EINTR:
|
case EINTR:
|
||||||
zfs_verror(hdl, EZFS_INTR, fmt, ap);
|
zfs_verror(hdl, EZFS_INTR, fmt, ap);
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
|
case ECKSUM:
|
||||||
|
zfs_verror(hdl, EZFS_CKSUM, fmt, ap);
|
||||||
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@@ -674,7 +680,7 @@ zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
|||||||
case ENOSPC:
|
case ENOSPC:
|
||||||
case EDQUOT:
|
case EDQUOT:
|
||||||
zfs_verror(hdl, EZFS_NOSPC, fmt, ap);
|
zfs_verror(hdl, EZFS_NOSPC, fmt, ap);
|
||||||
return (-1);
|
break;
|
||||||
|
|
||||||
case EAGAIN:
|
case EAGAIN:
|
||||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||||
@@ -2076,22 +2082,26 @@ use_color(void)
|
|||||||
* color_end();
|
* color_end();
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
color_start(char *color)
|
color_start(const char *color)
|
||||||
{
|
{
|
||||||
if (use_color())
|
if (use_color()) {
|
||||||
printf("%s", color);
|
fputs(color, stdout);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
color_end(void)
|
color_end(void)
|
||||||
{
|
{
|
||||||
if (use_color())
|
if (use_color()) {
|
||||||
printf(ANSI_RESET);
|
fputs(ANSI_RESET, stdout);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printf() with a color. If color is NULL, then do a normal printf. */
|
/* printf() with a color. If color is NULL, then do a normal printf. */
|
||||||
int
|
int
|
||||||
printf_color(char *color, char *format, ...)
|
printf_color(const char *color, char *format, ...)
|
||||||
{
|
{
|
||||||
va_list aptr;
|
va_list aptr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|||||||
@@ -35,6 +35,22 @@
|
|||||||
void
|
void
|
||||||
libzfs_set_pipe_max(int infd)
|
libzfs_set_pipe_max(int infd)
|
||||||
{
|
{
|
||||||
|
#if __linux__
|
||||||
|
/*
|
||||||
|
* Sadly, Linux has an unfixed deadlock if you do SETPIPE_SZ on a pipe
|
||||||
|
* with data in it.
|
||||||
|
* cf. #13232, https://bugzilla.kernel.org/show_bug.cgi?id=212295
|
||||||
|
*
|
||||||
|
* And since the problem is in waking up the writer, there's nothing
|
||||||
|
* we can do about it from here.
|
||||||
|
*
|
||||||
|
* So if people want to, they can set this, but they
|
||||||
|
* may regret it...
|
||||||
|
*/
|
||||||
|
if (getenv("ZFS_SET_PIPE_MAX") == NULL)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
FILE *procf = fopen("/proc/sys/fs/pipe-max-size", "re");
|
FILE *procf = fopen("/proc/sys/fs/pipe-max-size", "re");
|
||||||
|
|
||||||
if (procf != NULL) {
|
if (procf != NULL) {
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (zc.zc_nvlist_dst_filled) {
|
if (zc.zc_nvlist_dst_filled && resultp != NULL) {
|
||||||
*resultp = fnvlist_unpack((void *)(uintptr_t)zc.zc_nvlist_dst,
|
*resultp = fnvlist_unpack((void *)(uintptr_t)zc.zc_nvlist_dst,
|
||||||
zc.zc_nvlist_dst_size);
|
zc.zc_nvlist_dst_size);
|
||||||
}
|
}
|
||||||
@@ -890,7 +890,8 @@ recv_impl(const char *snapname, nvlist_t *recvdprops, nvlist_t *localprops,
|
|||||||
fnvlist_free(outnvl);
|
fnvlist_free(outnvl);
|
||||||
} else {
|
} else {
|
||||||
zfs_cmd_t zc = {"\0"};
|
zfs_cmd_t zc = {"\0"};
|
||||||
char *packed = NULL;
|
char *rp_packed = NULL;
|
||||||
|
char *lp_packed = NULL;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
ASSERT3S(g_refcount, >, 0);
|
ASSERT3S(g_refcount, >, 0);
|
||||||
@@ -899,14 +900,14 @@ recv_impl(const char *snapname, nvlist_t *recvdprops, nvlist_t *localprops,
|
|||||||
(void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
|
(void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
|
||||||
|
|
||||||
if (recvdprops != NULL) {
|
if (recvdprops != NULL) {
|
||||||
packed = fnvlist_pack(recvdprops, &size);
|
rp_packed = fnvlist_pack(recvdprops, &size);
|
||||||
zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed;
|
zc.zc_nvlist_src = (uint64_t)(uintptr_t)rp_packed;
|
||||||
zc.zc_nvlist_src_size = size;
|
zc.zc_nvlist_src_size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localprops != NULL) {
|
if (localprops != NULL) {
|
||||||
packed = fnvlist_pack(localprops, &size);
|
lp_packed = fnvlist_pack(localprops, &size);
|
||||||
zc.zc_nvlist_conf = (uint64_t)(uintptr_t)packed;
|
zc.zc_nvlist_conf = (uint64_t)(uintptr_t)lp_packed;
|
||||||
zc.zc_nvlist_conf_size = size;
|
zc.zc_nvlist_conf_size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -941,8 +942,10 @@ recv_impl(const char *snapname, nvlist_t *recvdprops, nvlist_t *localprops,
|
|||||||
zc.zc_nvlist_dst_size, errors, KM_SLEEP));
|
zc.zc_nvlist_dst_size, errors, KM_SLEEP));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packed != NULL)
|
if (rp_packed != NULL)
|
||||||
fnvlist_pack_free(packed, size);
|
fnvlist_pack_free(rp_packed, size);
|
||||||
|
if (lp_packed != NULL)
|
||||||
|
fnvlist_pack_free(lp_packed, size);
|
||||||
free((void *)(uintptr_t)zc.zc_nvlist_dst);
|
free((void *)(uintptr_t)zc.zc_nvlist_dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -173,12 +173,13 @@ set_global_var_parse_kv(const char *arg, char **k_out, u_longlong_t *v_out)
|
|||||||
goto err_free;
|
goto err_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
*k_out = k;
|
*k_out = strdup(k);
|
||||||
*v_out = val;
|
*v_out = val;
|
||||||
|
free(d);
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
err_free:
|
err_free:
|
||||||
free(k);
|
free(d);
|
||||||
|
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
@@ -227,13 +228,14 @@ set_global_var(char const *arg)
|
|||||||
fprintf(stderr, "Failed to open libzpool.so to set global "
|
fprintf(stderr, "Failed to open libzpool.so to set global "
|
||||||
"variable\n");
|
"variable\n");
|
||||||
ret = EIO;
|
ret = EIO;
|
||||||
goto out_dlclose;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out_dlclose:
|
out_dlclose:
|
||||||
dlclose(zpoolhdl);
|
dlclose(zpoolhdl);
|
||||||
|
out_free:
|
||||||
free(varname);
|
free(varname);
|
||||||
out_ret:
|
out_ret:
|
||||||
return (ret);
|
return (ret);
|
||||||
|
|||||||
@@ -265,7 +265,6 @@ zfs_get_pci_slots_sys_path(const char *dev_name)
|
|||||||
free(address2);
|
free(address2);
|
||||||
if (asprintf(&path, "/sys/bus/pci/slots/%s",
|
if (asprintf(&path, "/sys/bus/pci/slots/%s",
|
||||||
ep->d_name) == -1) {
|
ep->d_name) == -1) {
|
||||||
free(tmp);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -467,11 +467,9 @@ get_configs(libpc_handle_t *hdl, pool_list_t *pl, boolean_t active_ok,
|
|||||||
uint64_t guid;
|
uint64_t guid;
|
||||||
uint_t children = 0;
|
uint_t children = 0;
|
||||||
nvlist_t **child = NULL;
|
nvlist_t **child = NULL;
|
||||||
uint_t holes;
|
|
||||||
uint64_t *hole_array, max_id;
|
uint64_t *hole_array, max_id;
|
||||||
uint_t c;
|
uint_t c;
|
||||||
boolean_t isactive;
|
boolean_t isactive;
|
||||||
uint64_t hostid;
|
|
||||||
nvlist_t *nvl;
|
nvlist_t *nvl;
|
||||||
boolean_t valid_top_config = B_FALSE;
|
boolean_t valid_top_config = B_FALSE;
|
||||||
|
|
||||||
@@ -479,7 +477,8 @@ get_configs(libpc_handle_t *hdl, pool_list_t *pl, boolean_t active_ok,
|
|||||||
goto nomem;
|
goto nomem;
|
||||||
|
|
||||||
for (pe = pl->pools; pe != NULL; pe = pe->pe_next) {
|
for (pe = pl->pools; pe != NULL; pe = pe->pe_next) {
|
||||||
uint64_t id, max_txg = 0;
|
uint64_t id, max_txg = 0, hostid = 0;
|
||||||
|
uint_t holes = 0;
|
||||||
|
|
||||||
if (nvlist_alloc(&config, NV_UNIQUE_NAME, 0) != 0)
|
if (nvlist_alloc(&config, NV_UNIQUE_NAME, 0) != 0)
|
||||||
goto nomem;
|
goto nomem;
|
||||||
|
|||||||
+8
-1
@@ -1222,6 +1222,13 @@ Ideally, this will be at least the sum of each queue's
|
|||||||
.Sy max_active .
|
.Sy max_active .
|
||||||
.No See Sx ZFS I/O SCHEDULER .
|
.No See Sx ZFS I/O SCHEDULER .
|
||||||
.
|
.
|
||||||
|
.It Sy zfs_vdev_open_timeout_ms Ns = Ns Sy 1000 Pq uint
|
||||||
|
Timeout value to wait before determining a device is missing
|
||||||
|
during import.
|
||||||
|
This is helpful for transient missing paths due
|
||||||
|
to links being briefly removed and recreated in response to
|
||||||
|
udev events.
|
||||||
|
.
|
||||||
.It Sy zfs_vdev_rebuild_max_active Ns = Ns Sy 3 Pq int
|
.It Sy zfs_vdev_rebuild_max_active Ns = Ns Sy 3 Pq int
|
||||||
Maximum sequential resilver I/O operations active to each device.
|
Maximum sequential resilver I/O operations active to each device.
|
||||||
.No See Sx ZFS I/O SCHEDULER .
|
.No See Sx ZFS I/O SCHEDULER .
|
||||||
@@ -1651,7 +1658,7 @@ prefetched during a pool traversal, like
|
|||||||
.Nm zfs Cm send
|
.Nm zfs Cm send
|
||||||
or other data crawling operations.
|
or other data crawling operations.
|
||||||
.
|
.
|
||||||
.It Sy zfs_per_txg_dirty_frees_percent Ns = Ns Sy 5 Ns % Pq ulong
|
.It Sy zfs_per_txg_dirty_frees_percent Ns = Ns Sy 30 Ns % Pq ulong
|
||||||
Control percentage of dirtied indirect blocks from frees allowed into one TXG.
|
Control percentage of dirtied indirect blocks from frees allowed into one TXG.
|
||||||
After this threshold is crossed, additional frees will wait until the next TXG.
|
After this threshold is crossed, additional frees will wait until the next TXG.
|
||||||
.Sy 0 No disables this throttle.
|
.Sy 0 No disables this throttle.
|
||||||
|
|||||||
+15
-3
@@ -36,8 +36,9 @@
|
|||||||
.\" Copyright 2018 Nexenta Systems, Inc.
|
.\" Copyright 2018 Nexenta Systems, Inc.
|
||||||
.\" Copyright 2019 Joyent, Inc.
|
.\" Copyright 2019 Joyent, Inc.
|
||||||
.\" Copyright (c) 2019, Kjeld Schouten-Lebbing
|
.\" Copyright (c) 2019, Kjeld Schouten-Lebbing
|
||||||
|
.\" Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
|
||||||
.\"
|
.\"
|
||||||
.Dd May 24, 2021
|
.Dd July 21, 2022
|
||||||
.Dt ZFSPROPS 7
|
.Dt ZFSPROPS 7
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
@@ -1445,7 +1446,7 @@ affects only files created afterward; existing files are unaffected.
|
|||||||
.Pp
|
.Pp
|
||||||
This property can also be referred to by its shortened column name,
|
This property can also be referred to by its shortened column name,
|
||||||
.Sy recsize .
|
.Sy recsize .
|
||||||
.It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most
|
.It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most Ns | Ns Sy some Ns | Ns Sy none
|
||||||
Controls what types of metadata are stored redundantly.
|
Controls what types of metadata are stored redundantly.
|
||||||
ZFS stores an extra copy of metadata, so that if a single block is corrupted,
|
ZFS stores an extra copy of metadata, so that if a single block is corrupted,
|
||||||
the amount of user data lost is limited.
|
the amount of user data lost is limited.
|
||||||
@@ -1477,7 +1478,7 @@ When set to
|
|||||||
ZFS stores an extra copy of most types of metadata.
|
ZFS stores an extra copy of most types of metadata.
|
||||||
This can improve performance of random writes, because less metadata must be
|
This can improve performance of random writes, because less metadata must be
|
||||||
written.
|
written.
|
||||||
In practice, at worst about 100 blocks
|
In practice, at worst about 1000 blocks
|
||||||
.Po of
|
.Po of
|
||||||
.Sy recordsize
|
.Sy recordsize
|
||||||
bytes each
|
bytes each
|
||||||
@@ -1486,6 +1487,17 @@ of user data can be lost if a single on-disk block is corrupt.
|
|||||||
The exact behavior of which metadata blocks are stored redundantly may change in
|
The exact behavior of which metadata blocks are stored redundantly may change in
|
||||||
future releases.
|
future releases.
|
||||||
.Pp
|
.Pp
|
||||||
|
When set to
|
||||||
|
.Sy some ,
|
||||||
|
ZFS stores an extra copy of only critical metadata.
|
||||||
|
This can improve file create performance since less metadata needs to be written.
|
||||||
|
If a single on-disk block is corrupt, at worst a single user file can be lost.
|
||||||
|
.Pp
|
||||||
|
When set to
|
||||||
|
.Sy none ,
|
||||||
|
ZFS does not store any copies of metadata redundantly.
|
||||||
|
If a single on-disk block is corrupt, an entire dataset can be lost.
|
||||||
|
.Pp
|
||||||
The default value is
|
The default value is
|
||||||
.Sy all .
|
.Sy all .
|
||||||
.It Sy refquota Ns = Ns Ar size Ns | Ns Sy none
|
.It Sy refquota Ns = Ns Ar size Ns | Ns Sy none
|
||||||
|
|||||||
@@ -704,6 +704,12 @@ command will be undone if the share is ever unshared (like via a reboot).
|
|||||||
.El
|
.El
|
||||||
.
|
.
|
||||||
.Sh ENVIRONMENT VARIABLES
|
.Sh ENVIRONMENT VARIABLES
|
||||||
|
.Bl -tag -width "ZFS_COLOR"
|
||||||
|
.It Sy ZFS_COLOR
|
||||||
|
Use ANSI color in
|
||||||
|
.Nm zfs Cm diff
|
||||||
|
output.
|
||||||
|
.El
|
||||||
.Bl -tag -width "ZFS_MOUNT_HELPER"
|
.Bl -tag -width "ZFS_MOUNT_HELPER"
|
||||||
.It Sy ZFS_MOUNT_HELPER
|
.It Sy ZFS_MOUNT_HELPER
|
||||||
Cause
|
Cause
|
||||||
@@ -713,6 +719,14 @@ to use
|
|||||||
to mount ZFS datasets.
|
to mount ZFS datasets.
|
||||||
This option is provided for backwards compatibility with older ZFS versions.
|
This option is provided for backwards compatibility with older ZFS versions.
|
||||||
.El
|
.El
|
||||||
|
.Bl -tag -width "ZFS_SET_PIPE_MAX"
|
||||||
|
.It Sy ZFS_SET_PIPE_MAX
|
||||||
|
Tells
|
||||||
|
.Nm zfs
|
||||||
|
to set the maximum pipe size for sends/recieves.
|
||||||
|
Disabled by default on Linux
|
||||||
|
due to an unfixed deadlock in Linux's pipe size handling code.
|
||||||
|
.El
|
||||||
.
|
.
|
||||||
.Sh INTERFACE STABILITY
|
.Sh INTERFACE STABILITY
|
||||||
.Sy Committed .
|
.Sy Committed .
|
||||||
|
|||||||
@@ -60,12 +60,9 @@ $(MODULE)-$(CONFIG_X86) += algs/modes/gcm_pclmulqdq.o
|
|||||||
$(MODULE)-$(CONFIG_X86) += algs/aes/aes_impl_aesni.o
|
$(MODULE)-$(CONFIG_X86) += algs/aes/aes_impl_aesni.o
|
||||||
$(MODULE)-$(CONFIG_X86) += algs/aes/aes_impl_x86-64.o
|
$(MODULE)-$(CONFIG_X86) += algs/aes/aes_impl_x86-64.o
|
||||||
|
|
||||||
# Suppress objtool "can't find jump dest instruction at" warnings. They
|
# Suppress objtool "return with modified stack frame" warnings.
|
||||||
# are caused by the constants which are defined in the text section of the
|
|
||||||
# assembly file using .byte instructions (e.g. bswap_mask). The objtool
|
|
||||||
# utility tries to interpret them as opcodes and obviously fails doing so.
|
|
||||||
OBJECT_FILES_NON_STANDARD_aesni-gcm-x86_64.o := y
|
OBJECT_FILES_NON_STANDARD_aesni-gcm-x86_64.o := y
|
||||||
OBJECT_FILES_NON_STANDARD_ghash-x86_64.o := y
|
|
||||||
# Suppress objtool "unsupported stack pointer realignment" warnings. We are
|
# Suppress objtool "unsupported stack pointer realignment" warnings. We are
|
||||||
# not using a DRAP register while aligning the stack to a 64 byte boundary.
|
# not using a DRAP register while aligning the stack to a 64 byte boundary.
|
||||||
# See #6950 for the reasoning.
|
# See #6950 for the reasoning.
|
||||||
|
|||||||
@@ -704,6 +704,7 @@ enc_tab:
|
|||||||
|
|
||||||
|
|
||||||
ENTRY_NP(aes_encrypt_amd64)
|
ENTRY_NP(aes_encrypt_amd64)
|
||||||
|
ENDBR
|
||||||
#ifdef GLADMAN_INTERFACE
|
#ifdef GLADMAN_INTERFACE
|
||||||
// Original interface
|
// Original interface
|
||||||
sub $[4*8], %rsp // gnu/linux/opensolaris binary interface
|
sub $[4*8], %rsp // gnu/linux/opensolaris binary interface
|
||||||
@@ -809,6 +810,7 @@ dec_tab:
|
|||||||
|
|
||||||
|
|
||||||
ENTRY_NP(aes_decrypt_amd64)
|
ENTRY_NP(aes_decrypt_amd64)
|
||||||
|
ENDBR
|
||||||
#ifdef GLADMAN_INTERFACE
|
#ifdef GLADMAN_INTERFACE
|
||||||
// Original interface
|
// Original interface
|
||||||
sub $[4*8], %rsp // gnu/linux/opensolaris binary interface
|
sub $[4*8], %rsp // gnu/linux/opensolaris binary interface
|
||||||
|
|||||||
@@ -47,6 +47,9 @@
|
|||||||
#if defined(__x86_64__) && defined(HAVE_AVX) && \
|
#if defined(__x86_64__) && defined(HAVE_AVX) && \
|
||||||
defined(HAVE_AES) && defined(HAVE_PCLMULQDQ)
|
defined(HAVE_AES) && defined(HAVE_PCLMULQDQ)
|
||||||
|
|
||||||
|
#define _ASM
|
||||||
|
#include <sys/asm_linkage.h>
|
||||||
|
|
||||||
.extern gcm_avx_can_use_movbe
|
.extern gcm_avx_can_use_movbe
|
||||||
|
|
||||||
.text
|
.text
|
||||||
@@ -56,6 +59,7 @@
|
|||||||
.align 32
|
.align 32
|
||||||
_aesni_ctr32_ghash_6x:
|
_aesni_ctr32_ghash_6x:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
vmovdqu 32(%r11),%xmm2
|
vmovdqu 32(%r11),%xmm2
|
||||||
subq $6,%rdx
|
subq $6,%rdx
|
||||||
vpxor %xmm4,%xmm4,%xmm4
|
vpxor %xmm4,%xmm4,%xmm4
|
||||||
@@ -363,7 +367,7 @@ _aesni_ctr32_ghash_6x:
|
|||||||
vpxor 16+8(%rsp),%xmm8,%xmm8
|
vpxor 16+8(%rsp),%xmm8,%xmm8
|
||||||
vpxor %xmm4,%xmm8,%xmm8
|
vpxor %xmm4,%xmm8,%xmm8
|
||||||
|
|
||||||
.byte 0xf3,0xc3
|
RET
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
.size _aesni_ctr32_ghash_6x,.-_aesni_ctr32_ghash_6x
|
.size _aesni_ctr32_ghash_6x,.-_aesni_ctr32_ghash_6x
|
||||||
#endif /* ifdef HAVE_MOVBE */
|
#endif /* ifdef HAVE_MOVBE */
|
||||||
@@ -372,6 +376,7 @@ _aesni_ctr32_ghash_6x:
|
|||||||
.align 32
|
.align 32
|
||||||
_aesni_ctr32_ghash_no_movbe_6x:
|
_aesni_ctr32_ghash_no_movbe_6x:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
vmovdqu 32(%r11),%xmm2
|
vmovdqu 32(%r11),%xmm2
|
||||||
subq $6,%rdx
|
subq $6,%rdx
|
||||||
vpxor %xmm4,%xmm4,%xmm4
|
vpxor %xmm4,%xmm4,%xmm4
|
||||||
@@ -691,7 +696,7 @@ _aesni_ctr32_ghash_no_movbe_6x:
|
|||||||
vpxor 16+8(%rsp),%xmm8,%xmm8
|
vpxor 16+8(%rsp),%xmm8,%xmm8
|
||||||
vpxor %xmm4,%xmm8,%xmm8
|
vpxor %xmm4,%xmm8,%xmm8
|
||||||
|
|
||||||
.byte 0xf3,0xc3
|
RET
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
.size _aesni_ctr32_ghash_no_movbe_6x,.-_aesni_ctr32_ghash_no_movbe_6x
|
.size _aesni_ctr32_ghash_no_movbe_6x,.-_aesni_ctr32_ghash_no_movbe_6x
|
||||||
|
|
||||||
@@ -700,6 +705,7 @@ _aesni_ctr32_ghash_no_movbe_6x:
|
|||||||
.align 32
|
.align 32
|
||||||
aesni_gcm_decrypt:
|
aesni_gcm_decrypt:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
xorq %r10,%r10
|
xorq %r10,%r10
|
||||||
cmpq $0x60,%rdx
|
cmpq $0x60,%rdx
|
||||||
jb .Lgcm_dec_abort
|
jb .Lgcm_dec_abort
|
||||||
@@ -810,13 +816,14 @@ aesni_gcm_decrypt:
|
|||||||
.cfi_def_cfa_register %rsp
|
.cfi_def_cfa_register %rsp
|
||||||
.Lgcm_dec_abort:
|
.Lgcm_dec_abort:
|
||||||
movq %r10,%rax
|
movq %r10,%rax
|
||||||
.byte 0xf3,0xc3
|
RET
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
.size aesni_gcm_decrypt,.-aesni_gcm_decrypt
|
.size aesni_gcm_decrypt,.-aesni_gcm_decrypt
|
||||||
.type _aesni_ctr32_6x,@function
|
.type _aesni_ctr32_6x,@function
|
||||||
.align 32
|
.align 32
|
||||||
_aesni_ctr32_6x:
|
_aesni_ctr32_6x:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
vmovdqu 0-128(%rcx),%xmm4
|
vmovdqu 0-128(%rcx),%xmm4
|
||||||
vmovdqu 32(%r11),%xmm2
|
vmovdqu 32(%r11),%xmm2
|
||||||
leaq -2(%rbp),%r13 // ICP uses 10,12,14 not 9,11,13 for rounds.
|
leaq -2(%rbp),%r13 // ICP uses 10,12,14 not 9,11,13 for rounds.
|
||||||
@@ -880,7 +887,7 @@ _aesni_ctr32_6x:
|
|||||||
vmovups %xmm14,80(%rsi)
|
vmovups %xmm14,80(%rsi)
|
||||||
leaq 96(%rsi),%rsi
|
leaq 96(%rsi),%rsi
|
||||||
|
|
||||||
.byte 0xf3,0xc3
|
RET
|
||||||
.align 32
|
.align 32
|
||||||
.Lhandle_ctr32_2:
|
.Lhandle_ctr32_2:
|
||||||
vpshufb %xmm0,%xmm1,%xmm6
|
vpshufb %xmm0,%xmm1,%xmm6
|
||||||
@@ -911,6 +918,7 @@ _aesni_ctr32_6x:
|
|||||||
.align 32
|
.align 32
|
||||||
aesni_gcm_encrypt:
|
aesni_gcm_encrypt:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
xorq %r10,%r10
|
xorq %r10,%r10
|
||||||
cmpq $288,%rdx
|
cmpq $288,%rdx
|
||||||
jb .Lgcm_enc_abort
|
jb .Lgcm_enc_abort
|
||||||
@@ -1186,7 +1194,7 @@ aesni_gcm_encrypt:
|
|||||||
.cfi_def_cfa_register %rsp
|
.cfi_def_cfa_register %rsp
|
||||||
.Lgcm_enc_abort:
|
.Lgcm_enc_abort:
|
||||||
movq %r10,%rax
|
movq %r10,%rax
|
||||||
.byte 0xf3,0xc3
|
RET
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
.size aesni_gcm_encrypt,.-aesni_gcm_encrypt
|
.size aesni_gcm_encrypt,.-aesni_gcm_encrypt
|
||||||
|
|
||||||
@@ -1239,6 +1247,7 @@ atomic_toggle_boolean_nv:
|
|||||||
RET
|
RET
|
||||||
.size atomic_toggle_boolean_nv,.-atomic_toggle_boolean_nv
|
.size atomic_toggle_boolean_nv,.-atomic_toggle_boolean_nv
|
||||||
|
|
||||||
|
.pushsection .rodata
|
||||||
.align 64
|
.align 64
|
||||||
.Lbswap_mask:
|
.Lbswap_mask:
|
||||||
.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
|
.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
|
||||||
@@ -1252,6 +1261,7 @@ atomic_toggle_boolean_nv:
|
|||||||
.byte 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
.byte 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||||
.byte 65,69,83,45,78,73,32,71,67,77,32,109,111,100,117,108,101,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
.byte 65,69,83,45,78,73,32,71,67,77,32,109,111,100,117,108,101,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
||||||
.align 64
|
.align 64
|
||||||
|
.popsection
|
||||||
|
|
||||||
/* Mark the stack non-executable. */
|
/* Mark the stack non-executable. */
|
||||||
#if defined(__linux__) && defined(__ELF__)
|
#if defined(__linux__) && defined(__ELF__)
|
||||||
|
|||||||
@@ -97,6 +97,9 @@
|
|||||||
#if defined(__x86_64__) && defined(HAVE_AVX) && \
|
#if defined(__x86_64__) && defined(HAVE_AVX) && \
|
||||||
defined(HAVE_AES) && defined(HAVE_PCLMULQDQ)
|
defined(HAVE_AES) && defined(HAVE_PCLMULQDQ)
|
||||||
|
|
||||||
|
#define _ASM
|
||||||
|
#include <sys/asm_linkage.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
.globl gcm_gmult_clmul
|
.globl gcm_gmult_clmul
|
||||||
@@ -104,6 +107,7 @@
|
|||||||
.align 16
|
.align 16
|
||||||
gcm_gmult_clmul:
|
gcm_gmult_clmul:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
.L_gmult_clmul:
|
.L_gmult_clmul:
|
||||||
movdqu (%rdi),%xmm0
|
movdqu (%rdi),%xmm0
|
||||||
movdqa .Lbswap_mask(%rip),%xmm5
|
movdqa .Lbswap_mask(%rip),%xmm5
|
||||||
@@ -149,7 +153,7 @@ gcm_gmult_clmul:
|
|||||||
pxor %xmm1,%xmm0
|
pxor %xmm1,%xmm0
|
||||||
.byte 102,15,56,0,197
|
.byte 102,15,56,0,197
|
||||||
movdqu %xmm0,(%rdi)
|
movdqu %xmm0,(%rdi)
|
||||||
.byte 0xf3,0xc3
|
RET
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
.size gcm_gmult_clmul,.-gcm_gmult_clmul
|
.size gcm_gmult_clmul,.-gcm_gmult_clmul
|
||||||
|
|
||||||
@@ -158,6 +162,7 @@ gcm_gmult_clmul:
|
|||||||
.align 32
|
.align 32
|
||||||
gcm_init_htab_avx:
|
gcm_init_htab_avx:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
vzeroupper
|
vzeroupper
|
||||||
|
|
||||||
vmovdqu (%rsi),%xmm2
|
vmovdqu (%rsi),%xmm2
|
||||||
@@ -262,7 +267,7 @@ gcm_init_htab_avx:
|
|||||||
vmovdqu %xmm5,-16(%rdi)
|
vmovdqu %xmm5,-16(%rdi)
|
||||||
|
|
||||||
vzeroupper
|
vzeroupper
|
||||||
.byte 0xf3,0xc3
|
RET
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
.size gcm_init_htab_avx,.-gcm_init_htab_avx
|
.size gcm_init_htab_avx,.-gcm_init_htab_avx
|
||||||
|
|
||||||
@@ -271,6 +276,7 @@ gcm_init_htab_avx:
|
|||||||
.align 32
|
.align 32
|
||||||
gcm_gmult_avx:
|
gcm_gmult_avx:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
jmp .L_gmult_clmul
|
jmp .L_gmult_clmul
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
.size gcm_gmult_avx,.-gcm_gmult_avx
|
.size gcm_gmult_avx,.-gcm_gmult_avx
|
||||||
@@ -279,6 +285,7 @@ gcm_gmult_avx:
|
|||||||
.align 32
|
.align 32
|
||||||
gcm_ghash_avx:
|
gcm_ghash_avx:
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
vzeroupper
|
vzeroupper
|
||||||
|
|
||||||
vmovdqu (%rdi),%xmm10
|
vmovdqu (%rdi),%xmm10
|
||||||
@@ -649,9 +656,11 @@ gcm_ghash_avx:
|
|||||||
vpshufb %xmm13,%xmm10,%xmm10
|
vpshufb %xmm13,%xmm10,%xmm10
|
||||||
vmovdqu %xmm10,(%rdi)
|
vmovdqu %xmm10,(%rdi)
|
||||||
vzeroupper
|
vzeroupper
|
||||||
.byte 0xf3,0xc3
|
RET
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
.size gcm_ghash_avx,.-gcm_ghash_avx
|
.size gcm_ghash_avx,.-gcm_ghash_avx
|
||||||
|
|
||||||
|
.pushsection .rodata
|
||||||
.align 64
|
.align 64
|
||||||
.Lbswap_mask:
|
.Lbswap_mask:
|
||||||
.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
|
.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
|
||||||
@@ -705,6 +714,7 @@ gcm_ghash_avx:
|
|||||||
|
|
||||||
.byte 71,72,65,83,72,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
.byte 71,72,65,83,72,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
||||||
.align 64
|
.align 64
|
||||||
|
.popsection
|
||||||
|
|
||||||
/* Mark the stack non-executable. */
|
/* Mark the stack non-executable. */
|
||||||
#if defined(__linux__) && defined(__ELF__)
|
#if defined(__linux__) && defined(__ELF__)
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ SHA256TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num)
|
|||||||
|
|
||||||
ENTRY_NP(SHA256TransformBlocks)
|
ENTRY_NP(SHA256TransformBlocks)
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
movq %rsp, %rax
|
movq %rsp, %rax
|
||||||
.cfi_def_cfa_register %rax
|
.cfi_def_cfa_register %rax
|
||||||
push %rbx
|
push %rbx
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ SHA512TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num)
|
|||||||
|
|
||||||
ENTRY_NP(SHA512TransformBlocks)
|
ENTRY_NP(SHA512TransformBlocks)
|
||||||
.cfi_startproc
|
.cfi_startproc
|
||||||
|
ENDBR
|
||||||
movq %rsp, %rax
|
movq %rsp, %rax
|
||||||
.cfi_def_cfa_register %rax
|
.cfi_def_cfa_register %rax
|
||||||
push %rbx
|
push %rbx
|
||||||
|
|||||||
@@ -720,8 +720,8 @@ kcf_remove_mech_provider(char *mech_name, kcf_provider_desc_t *prov_desc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* free entry */
|
/* free entry */
|
||||||
KCF_PROV_REFRELE(prov_mech->pm_prov_desc);
|
|
||||||
KCF_PROV_IREFRELE(prov_mech->pm_prov_desc);
|
KCF_PROV_IREFRELE(prov_mech->pm_prov_desc);
|
||||||
|
KCF_PROV_REFRELE(prov_mech->pm_prov_desc);
|
||||||
kmem_free(prov_mech, sizeof (kcf_prov_mech_desc_t));
|
kmem_free(prov_mech, sizeof (kcf_prov_mech_desc_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ kcf_prov_tab_rem_provider(crypto_provider_id_t prov_id)
|
|||||||
* at that time.
|
* at that time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
KCF_PROV_REFRELE(prov_desc);
|
|
||||||
KCF_PROV_IREFRELE(prov_desc);
|
KCF_PROV_IREFRELE(prov_desc);
|
||||||
|
KCF_PROV_REFRELE(prov_desc);
|
||||||
|
|
||||||
return (CRYPTO_SUCCESS);
|
return (CRYPTO_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1274,7 +1274,7 @@ kcf_aop_done(kcf_areq_node_t *areq, int error)
|
|||||||
* Allocate the thread pool and initialize all the fields.
|
* Allocate the thread pool and initialize all the fields.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
kcfpool_alloc()
|
kcfpool_alloc(void)
|
||||||
{
|
{
|
||||||
kcfpool = kmem_alloc(sizeof (kcf_pool_t), KM_SLEEP);
|
kcfpool = kmem_alloc(sizeof (kcf_pool_t), KM_SLEEP);
|
||||||
|
|
||||||
|
|||||||
@@ -30,9 +30,29 @@
|
|||||||
#include <sys/stack.h>
|
#include <sys/stack.h>
|
||||||
#include <sys/trap.h>
|
#include <sys/trap.h>
|
||||||
|
|
||||||
#if defined(__linux__) && defined(CONFIG_SLS)
|
#if defined(_KERNEL) && defined(__linux__)
|
||||||
#define RET ret; int3
|
#include <linux/linkage.h>
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
#ifndef ENDBR
|
||||||
|
#if defined(__ELF__) && defined(__CET__) && defined(__has_include)
|
||||||
|
/* CSTYLED */
|
||||||
|
#if __has_include(<cet.h>)
|
||||||
|
|
||||||
|
#include <cet.h>
|
||||||
|
|
||||||
|
#ifdef _CET_ENDBR
|
||||||
|
#define ENDBR _CET_ENDBR
|
||||||
|
#endif /* _CET_ENDBR */
|
||||||
|
|
||||||
|
#endif /* <cet.h> */
|
||||||
|
#endif /* __ELF__ && __CET__ && __has_include */
|
||||||
|
#endif /* !ENDBR */
|
||||||
|
|
||||||
|
#ifndef ENDBR
|
||||||
|
#define ENDBR
|
||||||
|
#endif
|
||||||
|
#ifndef RET
|
||||||
#define RET ret
|
#define RET ret
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -204,6 +224,7 @@ sym1 = sym2
|
|||||||
* insert the calls to mcount for profiling. ENTRY_NP is identical, but
|
* insert the calls to mcount for profiling. ENTRY_NP is identical, but
|
||||||
* never calls mcount.
|
* never calls mcount.
|
||||||
*/
|
*/
|
||||||
|
#undef ENTRY
|
||||||
#define ENTRY(x) \
|
#define ENTRY(x) \
|
||||||
.text; \
|
.text; \
|
||||||
.align ASM_ENTRY_ALIGN; \
|
.align ASM_ENTRY_ALIGN; \
|
||||||
|
|||||||
@@ -823,12 +823,15 @@ sha2_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
|
|||||||
*/
|
*/
|
||||||
if (mechanism->cm_type % 3 == 2) {
|
if (mechanism->cm_type % 3 == 2) {
|
||||||
if (mechanism->cm_param == NULL ||
|
if (mechanism->cm_param == NULL ||
|
||||||
mechanism->cm_param_len != sizeof (ulong_t))
|
mechanism->cm_param_len != sizeof (ulong_t)) {
|
||||||
ret = CRYPTO_MECHANISM_PARAM_INVALID;
|
|
||||||
PROV_SHA2_GET_DIGEST_LEN(mechanism,
|
|
||||||
PROV_SHA2_HMAC_CTX(ctx)->hc_digest_len);
|
|
||||||
if (PROV_SHA2_HMAC_CTX(ctx)->hc_digest_len > sha_digest_len)
|
|
||||||
ret = CRYPTO_MECHANISM_PARAM_INVALID;
|
ret = CRYPTO_MECHANISM_PARAM_INVALID;
|
||||||
|
} else {
|
||||||
|
PROV_SHA2_GET_DIGEST_LEN(mechanism,
|
||||||
|
PROV_SHA2_HMAC_CTX(ctx)->hc_digest_len);
|
||||||
|
if (PROV_SHA2_HMAC_CTX(ctx)->hc_digest_len >
|
||||||
|
sha_digest_len)
|
||||||
|
ret = CRYPTO_MECHANISM_PARAM_INVALID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret != CRYPTO_SUCCESS) {
|
if (ret != CRYPTO_SUCCESS) {
|
||||||
|
|||||||
@@ -251,6 +251,8 @@ LUA_API int lua_type (lua_State *L, int idx) {
|
|||||||
|
|
||||||
LUA_API const char *lua_typename (lua_State *L, int t) {
|
LUA_API const char *lua_typename (lua_State *L, int t) {
|
||||||
UNUSED(L);
|
UNUSED(L);
|
||||||
|
if (t > 8 || t < 0)
|
||||||
|
return "internal_type_error";
|
||||||
return ttypename(t);
|
return ttypename(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ static lua_Number lua_strx2number (const char *s, char **endptr) {
|
|||||||
*endptr = cast(char *, s); /* valid up to here */
|
*endptr = cast(char *, s); /* valid up to here */
|
||||||
ret:
|
ret:
|
||||||
if (neg) r = -r;
|
if (neg) r = -r;
|
||||||
return (r * (1 << e));
|
return ((e >= 0) ? (r * (1ULL << e)) : (r / (1ULL << -e)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -23,7 +23,15 @@
|
|||||||
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(_KERNEL) && defined(__linux__)
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RET
|
||||||
|
#define RET ret
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef ENTRY
|
||||||
#define ENTRY(x) \
|
#define ENTRY(x) \
|
||||||
.text; \
|
.text; \
|
||||||
.align 8; \
|
.align 8; \
|
||||||
@@ -34,13 +42,6 @@ x:
|
|||||||
#define SET_SIZE(x) \
|
#define SET_SIZE(x) \
|
||||||
.size x, [.-x]
|
.size x, [.-x]
|
||||||
|
|
||||||
|
|
||||||
#if defined(__linux__) && defined(CONFIG_SLS)
|
|
||||||
#define RET ret; int3
|
|
||||||
#else
|
|
||||||
#define RET ret
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setjmp and longjmp implement non-local gotos using state vectors
|
* Setjmp and longjmp implement non-local gotos using state vectors
|
||||||
* type label_t.
|
* type label_t.
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <sys/kstat.h>
|
#include <sys/kstat.h>
|
||||||
#include <sys/sbuf.h>
|
#include <sys/sbuf.h>
|
||||||
|
#include <sys/zone.h>
|
||||||
|
|
||||||
static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics");
|
static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics");
|
||||||
|
|
||||||
@@ -134,6 +135,55 @@ kstat_sysctl_string(SYSCTL_HANDLER_ARGS)
|
|||||||
return (sysctl_handle_string(oidp, val, len, req));
|
return (sysctl_handle_string(oidp, val, len, req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
kstat_sysctl_dataset(SYSCTL_HANDLER_ARGS)
|
||||||
|
{
|
||||||
|
kstat_t *ksp = arg1;
|
||||||
|
kstat_named_t *ksent;
|
||||||
|
kstat_named_t *ksent_ds;
|
||||||
|
uint64_t val;
|
||||||
|
char *ds_name;
|
||||||
|
uint32_t ds_len = 0;
|
||||||
|
|
||||||
|
ksent_ds = ksent = ksp->ks_data;
|
||||||
|
ds_name = KSTAT_NAMED_STR_PTR(ksent_ds);
|
||||||
|
ds_len = KSTAT_NAMED_STR_BUFLEN(ksent_ds);
|
||||||
|
ds_name[ds_len-1] = '\0';
|
||||||
|
|
||||||
|
if (!zone_dataset_visible(ds_name, NULL)) {
|
||||||
|
return (EPERM);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Select the correct element */
|
||||||
|
ksent += arg2;
|
||||||
|
/* Update the aggsums before reading */
|
||||||
|
(void) ksp->ks_update(ksp, KSTAT_READ);
|
||||||
|
val = ksent->value.ui64;
|
||||||
|
|
||||||
|
return (sysctl_handle_64(oidp, &val, 0, req));
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
kstat_sysctl_dataset_string(SYSCTL_HANDLER_ARGS)
|
||||||
|
{
|
||||||
|
kstat_t *ksp = arg1;
|
||||||
|
kstat_named_t *ksent = ksp->ks_data;
|
||||||
|
char *val;
|
||||||
|
uint32_t len = 0;
|
||||||
|
|
||||||
|
/* Select the correct element */
|
||||||
|
ksent += arg2;
|
||||||
|
val = KSTAT_NAMED_STR_PTR(ksent);
|
||||||
|
len = KSTAT_NAMED_STR_BUFLEN(ksent);
|
||||||
|
val[len-1] = '\0';
|
||||||
|
|
||||||
|
if (!zone_dataset_visible(val, NULL)) {
|
||||||
|
return (EPERM);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (sysctl_handle_string(oidp, val, len, req));
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
kstat_sysctl_io(SYSCTL_HANDLER_ARGS)
|
kstat_sysctl_io(SYSCTL_HANDLER_ARGS)
|
||||||
{
|
{
|
||||||
@@ -422,11 +472,20 @@ kstat_install_named(kstat_t *ksp)
|
|||||||
ksp, i, kstat_sysctl, "Q", namelast);
|
ksp, i, kstat_sysctl, "Q", namelast);
|
||||||
break;
|
break;
|
||||||
case KSTAT_DATA_UINT64:
|
case KSTAT_DATA_UINT64:
|
||||||
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
if (strcmp(ksp->ks_class, "dataset") == 0) {
|
||||||
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
OID_AUTO, namelast,
|
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
||||||
CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
|
OID_AUTO, namelast,
|
||||||
ksp, i, kstat_sysctl, "QU", namelast);
|
CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||||
|
ksp, i, kstat_sysctl_dataset, "QU",
|
||||||
|
namelast);
|
||||||
|
} else {
|
||||||
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
|
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
||||||
|
OID_AUTO, namelast,
|
||||||
|
CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||||
|
ksp, i, kstat_sysctl, "QU", namelast);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case KSTAT_DATA_LONG:
|
case KSTAT_DATA_LONG:
|
||||||
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
@@ -443,11 +502,21 @@ kstat_install_named(kstat_t *ksp)
|
|||||||
ksp, i, kstat_sysctl, "LU", namelast);
|
ksp, i, kstat_sysctl, "LU", namelast);
|
||||||
break;
|
break;
|
||||||
case KSTAT_DATA_STRING:
|
case KSTAT_DATA_STRING:
|
||||||
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
if (strcmp(ksp->ks_class, "dataset") == 0) {
|
||||||
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
OID_AUTO, namelast,
|
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
||||||
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
|
OID_AUTO, namelast, CTLTYPE_STRING |
|
||||||
ksp, i, kstat_sysctl_string, "A", namelast);
|
CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||||
|
ksp, i, kstat_sysctl_dataset_string, "A",
|
||||||
|
namelast);
|
||||||
|
} else {
|
||||||
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
|
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
||||||
|
OID_AUTO, namelast, CTLTYPE_STRING |
|
||||||
|
CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||||
|
ksp, i, kstat_sysctl_string, "A",
|
||||||
|
namelast);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
panic("unsupported type: %d", typelast);
|
panic("unsupported type: %d", typelast);
|
||||||
|
|||||||
@@ -132,16 +132,13 @@ zfsdev_ioctl(struct cdev *dev, ulong_t zcmd, caddr_t arg, int flag,
|
|||||||
len = IOCPARM_LEN(zcmd);
|
len = IOCPARM_LEN(zcmd);
|
||||||
vecnum = zcmd & 0xff;
|
vecnum = zcmd & 0xff;
|
||||||
zp = (void *)arg;
|
zp = (void *)arg;
|
||||||
uaddr = (void *)zp->zfs_cmd;
|
|
||||||
error = 0;
|
error = 0;
|
||||||
zcl = NULL;
|
zcl = NULL;
|
||||||
|
|
||||||
if (len != sizeof (zfs_iocparm_t)) {
|
if (len != sizeof (zfs_iocparm_t))
|
||||||
printf("len %d vecnum: %d sizeof (zfs_cmd_t) %ju\n",
|
|
||||||
len, vecnum, (uintmax_t)sizeof (zfs_cmd_t));
|
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
}
|
|
||||||
|
|
||||||
|
uaddr = (void *)zp->zfs_cmd;
|
||||||
zc = kmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP);
|
zc = kmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP);
|
||||||
/*
|
/*
|
||||||
* Remap ioctl code for legacy user binaries
|
* Remap ioctl code for legacy user binaries
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ spa_generate_rootconf(const char *name)
|
|||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
uint64_t txg;
|
uint64_t txg;
|
||||||
|
|
||||||
|
if (configs[i] == NULL)
|
||||||
|
continue;
|
||||||
txg = fnvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG);
|
txg = fnvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG);
|
||||||
if (txg > best_txg) {
|
if (txg > best_txg) {
|
||||||
best_txg = txg;
|
best_txg = txg;
|
||||||
@@ -250,7 +252,7 @@ spa_import_rootpool(const char *name, bool checkpointrewind)
|
|||||||
mutex_exit(&spa_namespace_lock);
|
mutex_exit(&spa_namespace_lock);
|
||||||
fnvlist_free(config);
|
fnvlist_free(config);
|
||||||
cmn_err(CE_NOTE, "Can not parse the config for pool '%s'",
|
cmn_err(CE_NOTE, "Can not parse the config for pool '%s'",
|
||||||
pname);
|
name);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ zfs_ioctl_legacy_to_ozfs(int request)
|
|||||||
int
|
int
|
||||||
zfs_ioctl_ozfs_to_legacy(int request)
|
zfs_ioctl_ozfs_to_legacy(int request)
|
||||||
{
|
{
|
||||||
if (request > ZFS_IOC_LAST)
|
if (request >= ZFS_IOC_LAST)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
if (request > ZFS_IOC_PLATFORM) {
|
if (request > ZFS_IOC_PLATFORM) {
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ zfs_register_callbacks(vfs_t *vfsp)
|
|||||||
nbmand = B_FALSE;
|
nbmand = B_FALSE;
|
||||||
} else if (vfs_optionisset(vfsp, MNTOPT_NBMAND, NULL)) {
|
} else if (vfs_optionisset(vfsp, MNTOPT_NBMAND, NULL)) {
|
||||||
nbmand = B_TRUE;
|
nbmand = B_TRUE;
|
||||||
} else if ((error = dsl_prop_get_int_ds(ds, "nbmand", &nbmand) != 0)) {
|
} else if ((error = dsl_prop_get_int_ds(ds, "nbmand", &nbmand)) != 0) {
|
||||||
dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
|
dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
@@ -1845,7 +1845,8 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp)
|
|||||||
return (SET_ERROR(EINVAL));
|
return (SET_ERROR(EINVAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fidp->fid_len == LONG_FID_LEN && (fid_gen > 1 || setgen != 0)) {
|
if (fidp->fid_len == LONG_FID_LEN && setgen != 0) {
|
||||||
|
ZFS_EXIT(zfsvfs);
|
||||||
dprintf("snapdir fid: fid_gen (%llu) and setgen (%llu)\n",
|
dprintf("snapdir fid: fid_gen (%llu) and setgen (%llu)\n",
|
||||||
(u_longlong_t)fid_gen, (u_longlong_t)setgen);
|
(u_longlong_t)fid_gen, (u_longlong_t)setgen);
|
||||||
return (SET_ERROR(EINVAL));
|
return (SET_ERROR(EINVAL));
|
||||||
|
|||||||
@@ -536,6 +536,9 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
|
|||||||
* Acquire vnode lock before making it available to the world.
|
* Acquire vnode lock before making it available to the world.
|
||||||
*/
|
*/
|
||||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||||
|
#if __FreeBSD_version >= 1400077
|
||||||
|
vn_set_state(vp, VSTATE_CONSTRUCTED);
|
||||||
|
#endif
|
||||||
VN_LOCK_AREC(vp);
|
VN_LOCK_AREC(vp);
|
||||||
if (vp->v_type != VFIFO)
|
if (vp->v_type != VFIFO)
|
||||||
VN_LOCK_ASHARE(vp);
|
VN_LOCK_ASHARE(vp);
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/list.h>
|
#include <sys/list.h>
|
||||||
#include <sys/mutex.h>
|
|
||||||
#include <sys/procfs_list.h>
|
#include <sys/procfs_list.h>
|
||||||
#include <linux/proc_fs.h>
|
#include <linux/proc_fs.h>
|
||||||
|
#include <sys/mutex.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A procfs_list is a wrapper around a linked list which implements the seq_file
|
* A procfs_list is a wrapper around a linked list which implements the seq_file
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ static void *zfs_vdev_holder = VDEV_HOLDER;
|
|||||||
* device is missing. The missing path may be transient since the links
|
* device is missing. The missing path may be transient since the links
|
||||||
* can be briefly removed and recreated in response to udev events.
|
* can be briefly removed and recreated in response to udev events.
|
||||||
*/
|
*/
|
||||||
static unsigned zfs_vdev_open_timeout_ms = 1000;
|
static uint_t zfs_vdev_open_timeout_ms = 1000;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Size of the "reserved" partition, in blocks.
|
* Size of the "reserved" partition, in blocks.
|
||||||
@@ -1020,3 +1020,6 @@ param_set_max_auto_ashift(const char *buf, zfs_kernel_param_t *kp)
|
|||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZFS_MODULE_PARAM(zfs_vdev, zfs_vdev_, open_timeout_ms, UINT, ZMOD_RW,
|
||||||
|
"Timeout before determining that a device is missing");
|
||||||
|
|||||||
@@ -470,7 +470,6 @@ zfsctl_inode_alloc(zfsvfs_t *zfsvfs, uint64_t id,
|
|||||||
zp->z_is_sa = B_FALSE;
|
zp->z_is_sa = B_FALSE;
|
||||||
zp->z_is_mapped = B_FALSE;
|
zp->z_is_mapped = B_FALSE;
|
||||||
zp->z_is_ctldir = B_TRUE;
|
zp->z_is_ctldir = B_TRUE;
|
||||||
zp->z_is_stale = B_FALSE;
|
|
||||||
zp->z_sa_hdl = NULL;
|
zp->z_sa_hdl = NULL;
|
||||||
zp->z_blksz = 0;
|
zp->z_blksz = 0;
|
||||||
zp->z_seq = 0;
|
zp->z_seq = 0;
|
||||||
|
|||||||
@@ -1066,9 +1066,6 @@ zfs_make_xattrdir(znode_t *zp, vattr_t *vap, znode_t **xzpp, cred_t *cr)
|
|||||||
|
|
||||||
*xzpp = NULL;
|
*xzpp = NULL;
|
||||||
|
|
||||||
if ((error = zfs_zaccess(zp, ACE_WRITE_NAMED_ATTRS, 0, B_FALSE, cr)))
|
|
||||||
return (error);
|
|
||||||
|
|
||||||
if ((error = zfs_acl_ids_create(zp, IS_XATTR, vap, cr, NULL,
|
if ((error = zfs_acl_ids_create(zp, IS_XATTR, vap, cr, NULL,
|
||||||
&acl_ids)) != 0)
|
&acl_ids)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
|
|||||||
@@ -791,9 +791,7 @@ zfsvfs_create(const char *osname, boolean_t readonly, zfsvfs_t **zfvp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
error = zfsvfs_create_impl(zfvp, zfsvfs, os);
|
error = zfsvfs_create_impl(zfvp, zfsvfs, os);
|
||||||
if (error != 0) {
|
|
||||||
dmu_objset_disown(os, B_TRUE, zfsvfs);
|
|
||||||
}
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -833,6 +831,7 @@ zfsvfs_create_impl(zfsvfs_t **zfvp, zfsvfs_t *zfsvfs, objset_t *os)
|
|||||||
|
|
||||||
error = zfsvfs_init(zfsvfs, os);
|
error = zfsvfs_init(zfsvfs, os);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
|
dmu_objset_disown(os, B_TRUE, zfsvfs);
|
||||||
*zfvp = NULL;
|
*zfvp = NULL;
|
||||||
zfsvfs_free(zfsvfs);
|
zfsvfs_free(zfsvfs);
|
||||||
return (error);
|
return (error);
|
||||||
@@ -1501,7 +1500,6 @@ zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent)
|
|||||||
sb->s_op = &zpl_super_operations;
|
sb->s_op = &zpl_super_operations;
|
||||||
sb->s_xattr = zpl_xattr_handlers;
|
sb->s_xattr = zpl_xattr_handlers;
|
||||||
sb->s_export_op = &zpl_export_operations;
|
sb->s_export_op = &zpl_export_operations;
|
||||||
sb->s_d_op = &zpl_dentry_operations;
|
|
||||||
|
|
||||||
/* Set features for file system. */
|
/* Set features for file system. */
|
||||||
zfs_set_fuid_feature(zfsvfs);
|
zfs_set_fuid_feature(zfsvfs);
|
||||||
@@ -1535,6 +1533,7 @@ zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent)
|
|||||||
error = zfs_root(zfsvfs, &root_inode);
|
error = zfs_root(zfsvfs, &root_inode);
|
||||||
if (error) {
|
if (error) {
|
||||||
(void) zfs_umount(sb);
|
(void) zfs_umount(sb);
|
||||||
|
zfsvfs = NULL; /* avoid double-free; first in zfs_umount */
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1542,6 +1541,7 @@ zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent)
|
|||||||
sb->s_root = d_make_root(root_inode);
|
sb->s_root = d_make_root(root_inode);
|
||||||
if (sb->s_root == NULL) {
|
if (sb->s_root == NULL) {
|
||||||
(void) zfs_umount(sb);
|
(void) zfs_umount(sb);
|
||||||
|
zfsvfs = NULL; /* avoid double-free; first in zfs_umount */
|
||||||
error = SET_ERROR(ENOMEM);
|
error = SET_ERROR(ENOMEM);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -1858,8 +1858,8 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds)
|
|||||||
zp = list_next(&zfsvfs->z_all_znodes, zp)) {
|
zp = list_next(&zfsvfs->z_all_znodes, zp)) {
|
||||||
err2 = zfs_rezget(zp);
|
err2 = zfs_rezget(zp);
|
||||||
if (err2) {
|
if (err2) {
|
||||||
|
zpl_d_drop_aliases(ZTOI(zp));
|
||||||
remove_inode_hash(ZTOI(zp));
|
remove_inode_hash(ZTOI(zp));
|
||||||
zp->z_is_stale = B_TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* see comment in zfs_suspend_fs() */
|
/* see comment in zfs_suspend_fs() */
|
||||||
|
|||||||
@@ -579,6 +579,7 @@ zfs_create(znode_t *dzp, char *name, vattr_t *vap, int excl,
|
|||||||
boolean_t fuid_dirtied;
|
boolean_t fuid_dirtied;
|
||||||
boolean_t have_acl = B_FALSE;
|
boolean_t have_acl = B_FALSE;
|
||||||
boolean_t waited = B_FALSE;
|
boolean_t waited = B_FALSE;
|
||||||
|
boolean_t skip_acl = (flag & ATTR_NOACLCHECK) ? B_TRUE : B_FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have an ephemeral id, ACL, or XVATTR then
|
* If we have an ephemeral id, ACL, or XVATTR then
|
||||||
@@ -651,7 +652,7 @@ top:
|
|||||||
* Create a new file object and update the directory
|
* Create a new file object and update the directory
|
||||||
* to reference it.
|
* to reference it.
|
||||||
*/
|
*/
|
||||||
if ((error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, B_FALSE, cr))) {
|
if ((error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, skip_acl, cr))) {
|
||||||
if (have_acl)
|
if (have_acl)
|
||||||
zfs_acl_ids_free(&acl_ids);
|
zfs_acl_ids_free(&acl_ids);
|
||||||
goto out;
|
goto out;
|
||||||
|
|||||||
@@ -544,7 +544,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
|
|||||||
zp->z_atime_dirty = B_FALSE;
|
zp->z_atime_dirty = B_FALSE;
|
||||||
zp->z_is_mapped = B_FALSE;
|
zp->z_is_mapped = B_FALSE;
|
||||||
zp->z_is_ctldir = B_FALSE;
|
zp->z_is_ctldir = B_FALSE;
|
||||||
zp->z_is_stale = B_FALSE;
|
|
||||||
zp->z_suspended = B_FALSE;
|
zp->z_suspended = B_FALSE;
|
||||||
zp->z_sa_hdl = NULL;
|
zp->z_sa_hdl = NULL;
|
||||||
zp->z_mapcnt = 0;
|
zp->z_mapcnt = 0;
|
||||||
|
|||||||
@@ -224,12 +224,17 @@ zpl_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
|
|||||||
|
|
||||||
#ifdef HAVE_TMPFILE
|
#ifdef HAVE_TMPFILE
|
||||||
static int
|
static int
|
||||||
|
#ifndef HAVE_TMPFILE_DENTRY
|
||||||
|
zpl_tmpfile(struct user_namespace *userns, struct inode *dir,
|
||||||
|
struct file *file, umode_t mode)
|
||||||
|
#else
|
||||||
#ifdef HAVE_TMPFILE_USERNS
|
#ifdef HAVE_TMPFILE_USERNS
|
||||||
zpl_tmpfile(struct user_namespace *userns, struct inode *dir,
|
zpl_tmpfile(struct user_namespace *userns, struct inode *dir,
|
||||||
struct dentry *dentry, umode_t mode)
|
struct dentry *dentry, umode_t mode)
|
||||||
#else
|
#else
|
||||||
zpl_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
zpl_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
cred_t *cr = CRED();
|
cred_t *cr = CRED();
|
||||||
struct inode *ip;
|
struct inode *ip;
|
||||||
@@ -252,11 +257,21 @@ zpl_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
|||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
/* d_tmpfile will do drop_nlink, so we should set it first */
|
/* d_tmpfile will do drop_nlink, so we should set it first */
|
||||||
set_nlink(ip, 1);
|
set_nlink(ip, 1);
|
||||||
|
#ifndef HAVE_TMPFILE_DENTRY
|
||||||
|
d_tmpfile(file, ip);
|
||||||
|
|
||||||
|
error = zpl_xattr_security_init(ip, dir,
|
||||||
|
&file->f_path.dentry->d_name);
|
||||||
|
#else
|
||||||
d_tmpfile(dentry, ip);
|
d_tmpfile(dentry, ip);
|
||||||
|
|
||||||
error = zpl_xattr_security_init(ip, dir, &dentry->d_name);
|
error = zpl_xattr_security_init(ip, dir, &dentry->d_name);
|
||||||
|
#endif
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
error = zpl_init_acl(ip, dir);
|
error = zpl_init_acl(ip, dir);
|
||||||
|
#ifndef HAVE_TMPFILE_DENTRY
|
||||||
|
error = finish_open_simple(file, error);
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* don't need to handle error here, file is already in
|
* don't need to handle error here, file is already in
|
||||||
* unlinked set.
|
* unlinked set.
|
||||||
@@ -698,46 +713,6 @@ out:
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
#ifdef HAVE_D_REVALIDATE_NAMEIDATA
|
|
||||||
zpl_revalidate(struct dentry *dentry, struct nameidata *nd)
|
|
||||||
{
|
|
||||||
unsigned int flags = (nd ? nd->flags : 0);
|
|
||||||
#else
|
|
||||||
zpl_revalidate(struct dentry *dentry, unsigned int flags)
|
|
||||||
{
|
|
||||||
#endif /* HAVE_D_REVALIDATE_NAMEIDATA */
|
|
||||||
/* CSTYLED */
|
|
||||||
zfsvfs_t *zfsvfs = dentry->d_sb->s_fs_info;
|
|
||||||
int error;
|
|
||||||
|
|
||||||
if (flags & LOOKUP_RCU)
|
|
||||||
return (-ECHILD);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* After a rollback negative dentries created before the rollback
|
|
||||||
* time must be invalidated. Otherwise they can obscure files which
|
|
||||||
* are only present in the rolled back dataset.
|
|
||||||
*/
|
|
||||||
if (dentry->d_inode == NULL) {
|
|
||||||
spin_lock(&dentry->d_lock);
|
|
||||||
error = time_before(dentry->d_time, zfsvfs->z_rollback_time);
|
|
||||||
spin_unlock(&dentry->d_lock);
|
|
||||||
|
|
||||||
if (error)
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The dentry may reference a stale inode if a mounted file system
|
|
||||||
* was rolled back to a point in time where the object didn't exist.
|
|
||||||
*/
|
|
||||||
if (dentry->d_inode && ITOZ(dentry->d_inode)->z_is_stale)
|
|
||||||
return (0);
|
|
||||||
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct inode_operations zpl_inode_operations = {
|
const struct inode_operations zpl_inode_operations = {
|
||||||
.setattr = zpl_setattr,
|
.setattr = zpl_setattr,
|
||||||
.getattr = zpl_getattr,
|
.getattr = zpl_getattr,
|
||||||
@@ -751,7 +726,11 @@ const struct inode_operations zpl_inode_operations = {
|
|||||||
#if defined(HAVE_SET_ACL)
|
#if defined(HAVE_SET_ACL)
|
||||||
.set_acl = zpl_set_acl,
|
.set_acl = zpl_set_acl,
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
|
#if defined(HAVE_GET_INODE_ACL)
|
||||||
|
.get_inode_acl = zpl_get_acl,
|
||||||
|
#else
|
||||||
.get_acl = zpl_get_acl,
|
.get_acl = zpl_get_acl,
|
||||||
|
#endif /* HAVE_GET_INODE_ACL */
|
||||||
#endif /* CONFIG_FS_POSIX_ACL */
|
#endif /* CONFIG_FS_POSIX_ACL */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -784,7 +763,11 @@ const struct inode_operations zpl_dir_inode_operations = {
|
|||||||
#if defined(HAVE_SET_ACL)
|
#if defined(HAVE_SET_ACL)
|
||||||
.set_acl = zpl_set_acl,
|
.set_acl = zpl_set_acl,
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
|
#if defined(HAVE_GET_INODE_ACL)
|
||||||
|
.get_inode_acl = zpl_get_acl,
|
||||||
|
#else
|
||||||
.get_acl = zpl_get_acl,
|
.get_acl = zpl_get_acl,
|
||||||
|
#endif /* HAVE_GET_INODE_ACL */
|
||||||
#endif /* CONFIG_FS_POSIX_ACL */
|
#endif /* CONFIG_FS_POSIX_ACL */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -823,10 +806,10 @@ const struct inode_operations zpl_special_inode_operations = {
|
|||||||
#if defined(HAVE_SET_ACL)
|
#if defined(HAVE_SET_ACL)
|
||||||
.set_acl = zpl_set_acl,
|
.set_acl = zpl_set_acl,
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
|
#if defined(HAVE_GET_INODE_ACL)
|
||||||
|
.get_inode_acl = zpl_get_acl,
|
||||||
|
#else
|
||||||
.get_acl = zpl_get_acl,
|
.get_acl = zpl_get_acl,
|
||||||
|
#endif /* HAVE_GET_INODE_ACL */
|
||||||
#endif /* CONFIG_FS_POSIX_ACL */
|
#endif /* CONFIG_FS_POSIX_ACL */
|
||||||
};
|
};
|
||||||
|
|
||||||
dentry_operations_t zpl_dentry_operations = {
|
|
||||||
.d_revalidate = zpl_revalidate,
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ zpl_xattr_set_dir(struct inode *ip, const char *name, const void *value,
|
|||||||
vap->va_gid = crgetgid(cr);
|
vap->va_gid = crgetgid(cr);
|
||||||
|
|
||||||
error = -zfs_create(dxzp, (char *)name, vap, 0, 0644, &xzp,
|
error = -zfs_create(dxzp, (char *)name, vap, 0, 0644, &xzp,
|
||||||
cr, 0, NULL);
|
cr, ATTR_NOACLCHECK, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -1067,7 +1067,7 @@ zpl_get_acl_impl(struct inode *ip, int type)
|
|||||||
return (acl);
|
return (acl);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_GET_ACL_RCU)
|
#if defined(HAVE_GET_ACL_RCU) || defined(HAVE_GET_INODE_ACL)
|
||||||
struct posix_acl *
|
struct posix_acl *
|
||||||
zpl_get_acl(struct inode *ip, int type, bool rcu)
|
zpl_get_acl(struct inode *ip, int type, bool rcu)
|
||||||
{
|
{
|
||||||
@@ -1414,7 +1414,9 @@ zpl_xattr_handler(const char *name)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(HAVE_POSIX_ACL_RELEASE) || defined(HAVE_POSIX_ACL_RELEASE_GPL_ONLY)
|
#if defined(CONFIG_FS_POSIX_ACL) && \
|
||||||
|
(!defined(HAVE_POSIX_ACL_RELEASE) || \
|
||||||
|
defined(HAVE_POSIX_ACL_RELEASE_GPL_ONLY))
|
||||||
struct acl_rel_struct {
|
struct acl_rel_struct {
|
||||||
struct acl_rel_struct *next;
|
struct acl_rel_struct *next;
|
||||||
struct posix_acl *acl;
|
struct posix_acl *acl;
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
* Use is subject to license terms.
|
* Use is subject to license terms.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2022 MNX Cloud, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -213,10 +216,10 @@ const int8_t u8_number_of_bytes[0x100] = {
|
|||||||
/* 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F */
|
/* 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F */
|
||||||
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
||||||
|
|
||||||
/* 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F */
|
/* 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F */
|
||||||
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
||||||
|
|
||||||
/* A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF */
|
/* A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF */
|
||||||
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
||||||
|
|
||||||
/* B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF */
|
/* B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF */
|
||||||
@@ -1286,8 +1289,12 @@ TRY_THE_NEXT_MARK:
|
|||||||
saved_l = l - disp[last];
|
saved_l = l - disp[last];
|
||||||
|
|
||||||
while (p < oslast) {
|
while (p < oslast) {
|
||||||
size = u8_number_of_bytes[*p];
|
int8_t number_of_bytes = u8_number_of_bytes[*p];
|
||||||
if (size <= 1 || (p + size) > oslast)
|
|
||||||
|
if (number_of_bytes <= 1)
|
||||||
|
break;
|
||||||
|
size = number_of_bytes;
|
||||||
|
if ((p + size) > oslast)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
saved_p = p;
|
saved_p = p;
|
||||||
@@ -1378,8 +1385,10 @@ SAFE_RETURN:
|
|||||||
*/
|
*/
|
||||||
static size_t
|
static size_t
|
||||||
collect_a_seq(size_t uv, uchar_t *u8s, uchar_t **source, uchar_t *slast,
|
collect_a_seq(size_t uv, uchar_t *u8s, uchar_t **source, uchar_t *slast,
|
||||||
boolean_t is_it_toupper, boolean_t is_it_tolower,
|
boolean_t is_it_toupper,
|
||||||
boolean_t canonical_decomposition, boolean_t compatibility_decomposition,
|
boolean_t is_it_tolower,
|
||||||
|
boolean_t canonical_decomposition,
|
||||||
|
boolean_t compatibility_decomposition,
|
||||||
boolean_t canonical_composition,
|
boolean_t canonical_composition,
|
||||||
int *errnum, u8_normalization_states_t *state)
|
int *errnum, u8_normalization_states_t *state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
* Copyright 2016, Joyent, Inc.
|
* Copyright 2016, Joyent, Inc.
|
||||||
* Copyright (c) 2019, Klara Inc.
|
* Copyright (c) 2019, Klara Inc.
|
||||||
* Copyright (c) 2019, Allan Jude
|
* Copyright (c) 2019, Allan Jude
|
||||||
|
* Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Portions Copyright 2010 Robert Milkowski */
|
/* Portions Copyright 2010 Robert Milkowski */
|
||||||
@@ -371,6 +372,8 @@ zfs_prop_init(void)
|
|||||||
static zprop_index_t redundant_metadata_table[] = {
|
static zprop_index_t redundant_metadata_table[] = {
|
||||||
{ "all", ZFS_REDUNDANT_METADATA_ALL },
|
{ "all", ZFS_REDUNDANT_METADATA_ALL },
|
||||||
{ "most", ZFS_REDUNDANT_METADATA_MOST },
|
{ "most", ZFS_REDUNDANT_METADATA_MOST },
|
||||||
|
{ "some", ZFS_REDUNDANT_METADATA_SOME },
|
||||||
|
{ "none", ZFS_REDUNDANT_METADATA_NONE },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -387,7 +390,7 @@ zfs_prop_init(void)
|
|||||||
zprop_register_index(ZFS_PROP_REDUNDANT_METADATA, "redundant_metadata",
|
zprop_register_index(ZFS_PROP_REDUNDANT_METADATA, "redundant_metadata",
|
||||||
ZFS_REDUNDANT_METADATA_ALL,
|
ZFS_REDUNDANT_METADATA_ALL,
|
||||||
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
||||||
"all | most", "REDUND_MD",
|
"all | most | some | none", "REDUND_MD",
|
||||||
redundant_metadata_table);
|
redundant_metadata_table);
|
||||||
zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
|
zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
|
||||||
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
||||||
@@ -719,6 +722,8 @@ zfs_prop_init(void)
|
|||||||
boolean_t
|
boolean_t
|
||||||
zfs_prop_delegatable(zfs_prop_t prop)
|
zfs_prop_delegatable(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
zprop_desc_t *pd = &zfs_prop_table[prop];
|
zprop_desc_t *pd = &zfs_prop_table[prop];
|
||||||
|
|
||||||
/* The mlslabel property is never delegatable. */
|
/* The mlslabel property is never delegatable. */
|
||||||
@@ -841,6 +846,8 @@ zfs_prop_valid_for_type(int prop, zfs_type_t types, boolean_t headcheck)
|
|||||||
zprop_type_t
|
zprop_type_t
|
||||||
zfs_prop_get_type(zfs_prop_t prop)
|
zfs_prop_get_type(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_proptype);
|
return (zfs_prop_table[prop].pd_proptype);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -850,6 +857,8 @@ zfs_prop_get_type(zfs_prop_t prop)
|
|||||||
boolean_t
|
boolean_t
|
||||||
zfs_prop_readonly(zfs_prop_t prop)
|
zfs_prop_readonly(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_attr == PROP_READONLY ||
|
return (zfs_prop_table[prop].pd_attr == PROP_READONLY ||
|
||||||
zfs_prop_table[prop].pd_attr == PROP_ONETIME ||
|
zfs_prop_table[prop].pd_attr == PROP_ONETIME ||
|
||||||
zfs_prop_table[prop].pd_attr == PROP_ONETIME_DEFAULT);
|
zfs_prop_table[prop].pd_attr == PROP_ONETIME_DEFAULT);
|
||||||
@@ -861,6 +870,8 @@ zfs_prop_readonly(zfs_prop_t prop)
|
|||||||
boolean_t
|
boolean_t
|
||||||
zfs_prop_visible(zfs_prop_t prop)
|
zfs_prop_visible(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_visible &&
|
return (zfs_prop_table[prop].pd_visible &&
|
||||||
zfs_prop_table[prop].pd_zfs_mod_supported);
|
zfs_prop_table[prop].pd_zfs_mod_supported);
|
||||||
}
|
}
|
||||||
@@ -871,6 +882,8 @@ zfs_prop_visible(zfs_prop_t prop)
|
|||||||
boolean_t
|
boolean_t
|
||||||
zfs_prop_setonce(zfs_prop_t prop)
|
zfs_prop_setonce(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_attr == PROP_ONETIME ||
|
return (zfs_prop_table[prop].pd_attr == PROP_ONETIME ||
|
||||||
zfs_prop_table[prop].pd_attr == PROP_ONETIME_DEFAULT);
|
zfs_prop_table[prop].pd_attr == PROP_ONETIME_DEFAULT);
|
||||||
}
|
}
|
||||||
@@ -878,12 +891,16 @@ zfs_prop_setonce(zfs_prop_t prop)
|
|||||||
const char *
|
const char *
|
||||||
zfs_prop_default_string(zfs_prop_t prop)
|
zfs_prop_default_string(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_strdefault);
|
return (zfs_prop_table[prop].pd_strdefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
zfs_prop_default_numeric(zfs_prop_t prop)
|
zfs_prop_default_numeric(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_numdefault);
|
return (zfs_prop_table[prop].pd_numdefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -894,6 +911,8 @@ zfs_prop_default_numeric(zfs_prop_t prop)
|
|||||||
const char *
|
const char *
|
||||||
zfs_prop_to_name(zfs_prop_t prop)
|
zfs_prop_to_name(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_name);
|
return (zfs_prop_table[prop].pd_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,6 +922,8 @@ zfs_prop_to_name(zfs_prop_t prop)
|
|||||||
boolean_t
|
boolean_t
|
||||||
zfs_prop_inheritable(zfs_prop_t prop)
|
zfs_prop_inheritable(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_attr == PROP_INHERIT ||
|
return (zfs_prop_table[prop].pd_attr == PROP_INHERIT ||
|
||||||
zfs_prop_table[prop].pd_attr == PROP_ONETIME);
|
zfs_prop_table[prop].pd_attr == PROP_ONETIME);
|
||||||
}
|
}
|
||||||
@@ -955,6 +976,8 @@ zfs_prop_valid_keylocation(const char *str, boolean_t encrypted)
|
|||||||
const char *
|
const char *
|
||||||
zfs_prop_values(zfs_prop_t prop)
|
zfs_prop_values(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_values);
|
return (zfs_prop_table[prop].pd_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -966,6 +989,8 @@ zfs_prop_values(zfs_prop_t prop)
|
|||||||
int
|
int
|
||||||
zfs_prop_is_string(zfs_prop_t prop)
|
zfs_prop_is_string(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_proptype == PROP_TYPE_STRING ||
|
return (zfs_prop_table[prop].pd_proptype == PROP_TYPE_STRING ||
|
||||||
zfs_prop_table[prop].pd_proptype == PROP_TYPE_INDEX);
|
zfs_prop_table[prop].pd_proptype == PROP_TYPE_INDEX);
|
||||||
}
|
}
|
||||||
@@ -977,6 +1002,8 @@ zfs_prop_is_string(zfs_prop_t prop)
|
|||||||
const char *
|
const char *
|
||||||
zfs_prop_column_name(zfs_prop_t prop)
|
zfs_prop_column_name(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_colname);
|
return (zfs_prop_table[prop].pd_colname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -987,6 +1014,8 @@ zfs_prop_column_name(zfs_prop_t prop)
|
|||||||
boolean_t
|
boolean_t
|
||||||
zfs_prop_align_right(zfs_prop_t prop)
|
zfs_prop_align_right(zfs_prop_t prop)
|
||||||
{
|
{
|
||||||
|
ASSERT3S(prop, >=, 0);
|
||||||
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
||||||
return (zfs_prop_table[prop].pd_rightalign);
|
return (zfs_prop_table[prop].pd_rightalign);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -4460,7 +4460,7 @@ restart:
|
|||||||
* meta buffers. Requests to the upper layers will be made with
|
* meta buffers. Requests to the upper layers will be made with
|
||||||
* increasingly large scan sizes until the ARC is below the limit.
|
* increasingly large scan sizes until the ARC is below the limit.
|
||||||
*/
|
*/
|
||||||
if (meta_used > arc_meta_limit) {
|
if (meta_used > arc_meta_limit || arc_available_memory() < 0) {
|
||||||
if (type == ARC_BUFC_DATA) {
|
if (type == ARC_BUFC_DATA) {
|
||||||
type = ARC_BUFC_METADATA;
|
type = ARC_BUFC_METADATA;
|
||||||
} else {
|
} else {
|
||||||
@@ -5166,7 +5166,7 @@ arc_adapt(int bytes, arc_state_t *state)
|
|||||||
atomic_add_64(&arc_c, (int64_t)bytes);
|
atomic_add_64(&arc_c, (int64_t)bytes);
|
||||||
if (arc_c > arc_c_max)
|
if (arc_c > arc_c_max)
|
||||||
arc_c = arc_c_max;
|
arc_c = arc_c_max;
|
||||||
else if (state == arc_anon)
|
else if (state == arc_anon && arc_p < arc_c >> 1)
|
||||||
atomic_add_64(&arc_p, (int64_t)bytes);
|
atomic_add_64(&arc_p, (int64_t)bytes);
|
||||||
if (arc_p > arc_c)
|
if (arc_p > arc_c)
|
||||||
arc_p = arc_c;
|
arc_p = arc_c;
|
||||||
@@ -5379,7 +5379,8 @@ arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag,
|
|||||||
if (aggsum_upper_bound(&arc_sums.arcstat_size) < arc_c &&
|
if (aggsum_upper_bound(&arc_sums.arcstat_size) < arc_c &&
|
||||||
hdr->b_l1hdr.b_state == arc_anon &&
|
hdr->b_l1hdr.b_state == arc_anon &&
|
||||||
(zfs_refcount_count(&arc_anon->arcs_size) +
|
(zfs_refcount_count(&arc_anon->arcs_size) +
|
||||||
zfs_refcount_count(&arc_mru->arcs_size) > arc_p))
|
zfs_refcount_count(&arc_mru->arcs_size) > arc_p &&
|
||||||
|
arc_p < arc_c >> 1))
|
||||||
arc_p = MIN(arc_c, arc_p + size);
|
arc_p = MIN(arc_c, arc_p + size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -3300,10 +3300,10 @@ dbuf_prefetch_indirect_done(zio_t *zio, const zbookmark_phys_t *zb,
|
|||||||
blkptr_t *bp = ((blkptr_t *)abuf->b_data) +
|
blkptr_t *bp = ((blkptr_t *)abuf->b_data) +
|
||||||
P2PHASE(nextblkid, 1ULL << dpa->dpa_epbs);
|
P2PHASE(nextblkid, 1ULL << dpa->dpa_epbs);
|
||||||
|
|
||||||
ASSERT(!BP_IS_REDACTED(bp) ||
|
ASSERT(!BP_IS_REDACTED(bp) || (dpa->dpa_dnode &&
|
||||||
dsl_dataset_feature_is_active(
|
dsl_dataset_feature_is_active(
|
||||||
dpa->dpa_dnode->dn_objset->os_dsl_dataset,
|
dpa->dpa_dnode->dn_objset->os_dsl_dataset,
|
||||||
SPA_FEATURE_REDACTED_DATASETS));
|
SPA_FEATURE_REDACTED_DATASETS)));
|
||||||
if (BP_IS_HOLE(bp) || BP_IS_REDACTED(bp)) {
|
if (BP_IS_HOLE(bp) || BP_IS_REDACTED(bp)) {
|
||||||
dbuf_prefetch_fini(dpa, B_TRUE);
|
dbuf_prefetch_fini(dpa, B_TRUE);
|
||||||
} else if (dpa->dpa_curlevel == dpa->dpa_zb.zb_level) {
|
} else if (dpa->dpa_curlevel == dpa->dpa_zb.zb_level) {
|
||||||
|
|||||||
+17
-6
@@ -28,6 +28,7 @@
|
|||||||
* Copyright (c) 2019 Datto Inc.
|
* Copyright (c) 2019 Datto Inc.
|
||||||
* Copyright (c) 2019, Klara Inc.
|
* Copyright (c) 2019, Klara Inc.
|
||||||
* Copyright (c) 2019, Allan Jude
|
* Copyright (c) 2019, Allan Jude
|
||||||
|
* Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/dmu.h>
|
#include <sys/dmu.h>
|
||||||
@@ -70,7 +71,7 @@ int zfs_nopwrite_enabled = 1;
|
|||||||
* will wait until the next TXG.
|
* will wait until the next TXG.
|
||||||
* A value of zero will disable this throttle.
|
* A value of zero will disable this throttle.
|
||||||
*/
|
*/
|
||||||
unsigned long zfs_per_txg_dirty_frees_percent = 5;
|
unsigned long zfs_per_txg_dirty_frees_percent = 30;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable/disable forcing txg sync when dirty checking for holes with lseek().
|
* Enable/disable forcing txg sync when dirty checking for holes with lseek().
|
||||||
@@ -1988,12 +1989,22 @@ dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp)
|
|||||||
ZCHECKSUM_FLAG_EMBEDDED))
|
ZCHECKSUM_FLAG_EMBEDDED))
|
||||||
checksum = ZIO_CHECKSUM_FLETCHER_4;
|
checksum = ZIO_CHECKSUM_FLETCHER_4;
|
||||||
|
|
||||||
if (os->os_redundant_metadata == ZFS_REDUNDANT_METADATA_ALL ||
|
switch (os->os_redundant_metadata) {
|
||||||
(os->os_redundant_metadata ==
|
case ZFS_REDUNDANT_METADATA_ALL:
|
||||||
ZFS_REDUNDANT_METADATA_MOST &&
|
|
||||||
(level >= zfs_redundant_metadata_most_ditto_level ||
|
|
||||||
DMU_OT_IS_METADATA(type) || (wp & WP_SPILL))))
|
|
||||||
copies++;
|
copies++;
|
||||||
|
break;
|
||||||
|
case ZFS_REDUNDANT_METADATA_MOST:
|
||||||
|
if (level >= zfs_redundant_metadata_most_ditto_level ||
|
||||||
|
DMU_OT_IS_METADATA(type) || (wp & WP_SPILL))
|
||||||
|
copies++;
|
||||||
|
break;
|
||||||
|
case ZFS_REDUNDANT_METADATA_SOME:
|
||||||
|
if (DMU_OT_IS_CRITICAL(type))
|
||||||
|
copies++;
|
||||||
|
break;
|
||||||
|
case ZFS_REDUNDANT_METADATA_NONE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else if (wp & WP_NOFILL) {
|
} else if (wp & WP_NOFILL) {
|
||||||
ASSERT(level == 0);
|
ASSERT(level == 0);
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user