vboxsf fixes for v6.9-1

Highlights:
 - Compiler warning fixes
 - Explicitly deny setlease attempts
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmYNemEUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9wc1Af/fqfUUusaYW408D3PukjUaOVF+0wo
 6wluwCxy/DEMBxIQbGACwYoQuULHkgyK5chcEZvdB56vullqePCwOKeJUeKs75MR
 HzG9NLs2qIN9WJ6cSHTQlBzvVIK7WV64BDtauD8FH3Afa5c5ojr1JqEAxebnlonI
 cmFUm5x1TlMQryXcY8rPU9sdeaowlNiE/g7qRNqRfsjCGz2zWJdtjskf8YjOY5yB
 KqulZnye04dEb6Wp8fGuNWauUAJ6gTwSJxlcPU0oHv+fRaYebnqTZZaJrg5kKF4a
 SF4llaPM3d714udHOZP3Ro2K+SRoj5jUNSfO7jxNNk6DZ4xB47iXqNJ/Sw==
 =HDgT
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2024-04-03 10:30:52 -07:00
commit c85af715ca
3 changed files with 6 additions and 7 deletions

View File

@ -218,6 +218,7 @@ const struct file_operations vboxsf_reg_fops = {
.release = vboxsf_file_release,
.fsync = noop_fsync,
.splice_read = filemap_splice_read,
.setlease = simple_nosetlease,
};
const struct inode_operations vboxsf_reg_iops = {

View File

@ -151,11 +151,11 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
if (!sbi->nls) {
vbg_err("vboxsf: Count not load '%s' nls\n", nls_name);
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) {
err = sbi->bdi_id;
goto fail_free;
@ -221,9 +221,10 @@ fail_unmap:
vboxsf_unmap_folder(sbi->root);
fail_free:
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)
unload_nls(sbi->nls);
fail_destroy_idr:
idr_destroy(&sbi->ino_idr);
kfree(sbi);
return err;
@ -268,7 +269,7 @@ static void vboxsf_put_super(struct super_block *sb)
vboxsf_unmap_folder(sbi->root);
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)
unload_nls(sbi->nls);

View File

@ -440,7 +440,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len,
{
const char *in;
char *out;
size_t out_len;
size_t out_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,
in_bound_len = utf8_len;
out = name;
out_len = 0;
/* Reserve space for terminating 0 */
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,
out += nb;
out_bound_len -= nb;
out_len += nb;
}
*out = 0;