Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Umer Saleem <[email protected]>
  • Loading branch information
usaleem-ix committed Oct 15, 2024
1 parent 076ff15 commit 8fd5dc5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions module/os/linux/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,12 +1097,13 @@ is_current_chrooted(void)
struct task_struct *curr = current, *global = &init_task;
struct path cr_root, gl_root;

task_lock(global);
get_fs_root(global->fs, &gl_root);
get_fs_root(curr->fs, &cr_root);
int chrooted = !path_equal(&cr_root, &gl_root);

path_put(&cr_root);
path_put(&gl_root);
task_unlock(global);
path_put(&cr_root);

return (chrooted);
}
Expand Down Expand Up @@ -1201,14 +1202,20 @@ zfsctl_snapshot_mount(struct path *path, int flags)
}
mutex_enter(&zfsvfs->z_vfs->vfs_mntpt_lock);
if (zfsvfs->z_vfs->vfs_mntpoint != NULL) {
zfs_dbgmsg("vfs_mntpoint is not NULL");
/*
* If current mnountpoint and vfs_mntpoint are not same,
* store current mountpoint in vfs_mntpoint.
*/
if (strcmp(zfsvfs->z_vfs->vfs_mntpoint, m) != 0) {
zfs_dbgmsg("vfs_mntpoint and current mountpoint are not same");

Check failure on line 1211 in module/os/linux/zfs/zfs_ctldir.c

View workflow job for this annotation

GitHub Actions / checkstyle

line > 80 characters
zfs_dbgmsg("vfs_mntpoint: %s current mountpoint: %s", zfsvfs->z_vfs->vfs_mntpoint, m);

Check failure on line 1212 in module/os/linux/zfs/zfs_ctldir.c

View workflow job for this annotation

GitHub Actions / checkstyle

line > 80 characters
kmem_strfree(zfsvfs->z_vfs->vfs_mntpoint);
zfsvfs->z_vfs->vfs_mntpoint = kmem_strdup(m);
}
} else {
zfs_dbgmsg("vfs_mntpoint is NULL");
zfsvfs->z_vfs->vfs_mntpoint = kmem_strdup(m);
}
mutex_exit(&zfsvfs->z_vfs->vfs_mntpt_lock);
kmem_free(m, MAXPATHLEN);
Expand Down

0 comments on commit 8fd5dc5

Please sign in to comment.