Skip to content

Commit c85af71

Browse files
committed
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
2 parents 0f099dc + 1ece2c4 commit c85af71

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

fs/vboxsf/file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ const struct file_operations vboxsf_reg_fops = {
218218
.release = vboxsf_file_release,
219219
.fsync = noop_fsync,
220220
.splice_read = filemap_splice_read,
221+
.setlease = simple_nosetlease,
221222
};
222223

223224
const struct inode_operations vboxsf_reg_iops = {

fs/vboxsf/super.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
151151
if (!sbi->nls) {
152152
vbg_err("vboxsf: Count not load '%s' nls\n", nls_name);
153153
err = -EINVAL;
154-
goto fail_free;
154+
goto fail_destroy_idr;
155155
}
156156
}
157157

158-
sbi->bdi_id = ida_simple_get(&vboxsf_bdi_ida, 0, 0, GFP_KERNEL);
158+
sbi->bdi_id = ida_alloc(&vboxsf_bdi_ida, GFP_KERNEL);
159159
if (sbi->bdi_id < 0) {
160160
err = sbi->bdi_id;
161161
goto fail_free;
@@ -221,9 +221,10 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
221221
vboxsf_unmap_folder(sbi->root);
222222
fail_free:
223223
if (sbi->bdi_id >= 0)
224-
ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
224+
ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
225225
if (sbi->nls)
226226
unload_nls(sbi->nls);
227+
fail_destroy_idr:
227228
idr_destroy(&sbi->ino_idr);
228229
kfree(sbi);
229230
return err;
@@ -268,7 +269,7 @@ static void vboxsf_put_super(struct super_block *sb)
268269

269270
vboxsf_unmap_folder(sbi->root);
270271
if (sbi->bdi_id >= 0)
271-
ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
272+
ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
272273
if (sbi->nls)
273274
unload_nls(sbi->nls);
274275

fs/vboxsf/utils.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,13 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len,
440440
{
441441
const char *in;
442442
char *out;
443-
size_t out_len;
444443
size_t out_bound_len;
445444
size_t in_bound_len;
446445

447446
in = utf8_name;
448447
in_bound_len = utf8_len;
449448

450449
out = name;
451-
out_len = 0;
452450
/* Reserve space for terminating 0 */
453451
out_bound_len = name_bound_len - 1;
454452

@@ -469,7 +467,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len,
469467

470468
out += nb;
471469
out_bound_len -= nb;
472-
out_len += nb;
473470
}
474471

475472
*out = 0;

0 commit comments

Comments
 (0)