Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zed/udev thrashing due to autoexpand=on #7393

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/libzfs/libzfs_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2454,12 +2454,15 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *path, const char *msg)
*
* Also, we don't call efi_rescan() - that would just return EBUSY.
* The module will do it for us in vdev_disk_open().
*
* On success flush the buffers to disk and invalidate the page cache
* to ensure a consistent view of the relabled device.
*/
error = efi_use_whole_disk(fd);

/* Flush the buffers to disk and invalidate the page cache. */
(void) fsync(fd);
(void) ioctl(fd, BLKFLSBUF);
if (error == 0) {
(void) fsync(fd);
(void) ioctl(fd, BLKFLSBUF);
}

(void) close(fd);
if (error && error != VT_ENOSPC) {
Expand Down