]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix variable shadowing in libzfs_mount
authorReno Reckling <e-github@wthack.de>
Thu, 2 Feb 2023 23:22:12 +0000 (00:22 +0100)
committerGitHub <noreply@github.com>
Thu, 2 Feb 2023 23:22:12 +0000 (15:22 -0800)
We accidentally reused variable name "i" for inner and outer loops.

Reviewed-by: Rich Ercolani <Rincebrain@gmail.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Reno Reckling <e-github@wthack.de>
Closes #14452
Closes #14445

lib/libzfs/libzfs_mount.c

index 57737bc6c01ad76f21bbea0da09941e9672a7ba3..8612e082ba3447fe810ce3a030466b1de6602864 100644 (file)
@@ -1422,10 +1422,10 @@ zpool_disable_datasets(zpool_handle_t *zhp, boolean_t force)
         * Walk through and first unshare everything.
         */
        for (i = 0; i < used; i++) {
-               for (enum sa_protocol i = 0; i < SA_PROTOCOL_COUNT; ++i) {
-                       if (sa_is_shared(sets[i].mountpoint, i) &&
+               for (enum sa_protocol p = 0; p < SA_PROTOCOL_COUNT; ++p) {
+                       if (sa_is_shared(sets[i].mountpoint, p) &&
                            unshare_one(hdl, sets[i].mountpoint,
-                           sets[i].mountpoint, i) != 0)
+                           sets[i].mountpoint, p) != 0)
                                goto out;
                }
        }