Commit c85af715 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'vboxsf-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux

Pull vboxsf fixes from Hans de Goede:

 - Compiler warning fixes

 - Explicitly deny setlease attempts

* tag 'vboxsf-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux:
  vboxsf: explicitly deny setlease attempts
  vboxsf: Remove usage of the deprecated ida_simple_xx() API
  vboxsf: Avoid an spurious warning if load_nls_xxx() fails
  vboxsf: remove redundant variable out_len
parents 0f099dc9 1ece2c43
...@@ -218,6 +218,7 @@ const struct file_operations vboxsf_reg_fops = { ...@@ -218,6 +218,7 @@ const struct file_operations vboxsf_reg_fops = {
.release = vboxsf_file_release, .release = vboxsf_file_release,
.fsync = noop_fsync, .fsync = noop_fsync,
.splice_read = filemap_splice_read, .splice_read = filemap_splice_read,
.setlease = simple_nosetlease,
}; };
const struct inode_operations vboxsf_reg_iops = { const struct inode_operations vboxsf_reg_iops = {
......
...@@ -151,11 +151,11 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc) ...@@ -151,11 +151,11 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
if (!sbi->nls) { if (!sbi->nls) {
vbg_err("vboxsf: Count not load '%s' nls\n", nls_name); vbg_err("vboxsf: Count not load '%s' nls\n", nls_name);
err = -EINVAL; err = -EINVAL;
goto fail_free; goto fail_destroy_idr;
} }
} }
sbi->bdi_id = ida_simple_get(&vboxsf_bdi_ida, 0, 0, GFP_KERNEL); sbi->bdi_id = ida_alloc(&vboxsf_bdi_ida, GFP_KERNEL);
if (sbi->bdi_id < 0) { if (sbi->bdi_id < 0) {
err = sbi->bdi_id; err = sbi->bdi_id;
goto fail_free; goto fail_free;
...@@ -221,9 +221,10 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc) ...@@ -221,9 +221,10 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
vboxsf_unmap_folder(sbi->root); vboxsf_unmap_folder(sbi->root);
fail_free: fail_free:
if (sbi->bdi_id >= 0) if (sbi->bdi_id >= 0)
ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id); ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
if (sbi->nls) if (sbi->nls)
unload_nls(sbi->nls); unload_nls(sbi->nls);
fail_destroy_idr:
idr_destroy(&sbi->ino_idr); idr_destroy(&sbi->ino_idr);
kfree(sbi); kfree(sbi);
return err; return err;
...@@ -268,7 +269,7 @@ static void vboxsf_put_super(struct super_block *sb) ...@@ -268,7 +269,7 @@ static void vboxsf_put_super(struct super_block *sb)
vboxsf_unmap_folder(sbi->root); vboxsf_unmap_folder(sbi->root);
if (sbi->bdi_id >= 0) if (sbi->bdi_id >= 0)
ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id); ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
if (sbi->nls) if (sbi->nls)
unload_nls(sbi->nls); unload_nls(sbi->nls);
......
...@@ -440,7 +440,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len, ...@@ -440,7 +440,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len,
{ {
const char *in; const char *in;
char *out; char *out;
size_t out_len;
size_t out_bound_len; size_t out_bound_len;
size_t in_bound_len; size_t in_bound_len;
...@@ -448,7 +447,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len, ...@@ -448,7 +447,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len,
in_bound_len = utf8_len; in_bound_len = utf8_len;
out = name; out = name;
out_len = 0;
/* Reserve space for terminating 0 */ /* Reserve space for terminating 0 */
out_bound_len = name_bound_len - 1; out_bound_len = name_bound_len - 1;
...@@ -469,7 +467,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len, ...@@ -469,7 +467,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len,
out += nb; out += nb;
out_bound_len -= nb; out_bound_len -= nb;
out_len += nb;
} }
*out = 0; *out = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment