Skip to content

Commit

Permalink
10215 lofiadm -la fails after lofiadm -a / lofiadm -d
Browse files Browse the repository at this point in the history
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Gergő Doma <domag02@gmail.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
tsoome authored and Dan McDonald committed Jan 17, 2019
1 parent c8cc685 commit 45ca534
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion usr/src/uts/common/io/lofi.c
Expand Up @@ -173,7 +173,7 @@
#define SIZE_PROP_NAME "Size"
#define ZONE_PROP_NAME "zone"

#define SETUP_C_DATA(cd, buf, len) \
#define SETUP_C_DATA(cd, buf, len) \
(cd).cd_format = CRYPTO_DATA_RAW; \
(cd).cd_offset = 0; \
(cd).cd_miscdata = NULL; \
Expand Down Expand Up @@ -2954,6 +2954,7 @@ lofi_unmap_file(struct lofi_ioctl *ulip, int byfilename,
{
struct lofi_state *lsp;
struct lofi_ioctl *klip;
char namebuf[MAXNAMELEN];
int err;

err = copy_in_lofi_ioctl(ulip, &klip, ioctl_flag);
Expand All @@ -2979,6 +2980,7 @@ lofi_unmap_file(struct lofi_ioctl *ulip, int byfilename,
}

klip->li_id = LOFI_MINOR2ID(getminor(lsp->ls_dev));
(void) snprintf(namebuf, sizeof (namebuf), "%u", klip->li_id);

/*
* If it's still held open, we'll do one of three things:
Expand Down Expand Up @@ -3023,6 +3025,10 @@ lofi_unmap_file(struct lofi_ioctl *ulip, int byfilename,
lofi_destroy(lsp, credp);
}

/* Remove name from devlink cache */
mutex_enter(&lofi_devlink_cache.ln_lock);
(void) nvlist_remove_all(lofi_devlink_cache.ln_data, namebuf);
mutex_exit(&lofi_devlink_cache.ln_lock);
done:
mutex_exit(&lofi_lock);
if (err == 0)
Expand Down

0 comments on commit 45ca534

Please sign in to comment.