Project

General

Profile

Actions

Bug #1303

closed

Make vnconfig -l handle gracefully inaccessible special files

Added by Anonymous over 15 years ago. Updated over 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Greetings everyone.

The problem with vnconfig -l is that as soon as it encounters an error, it stops
listing the rest of the vn devices. On top of that, if the error is due to a
inaccessible special file, a broken message is printed.

How to reproduce it.
[beket@sadness ~] dd if=/dev/zero of=lala.img bs=10M count=1
[beket@sadness ~] dd if=/dev/zero of=foo.img bs=10M count=1
[beket@sadness ~] sudo vnconfig vn0 lala.img
[beket@sadness ~] sudo vnconfig vn3 foo.img
[beket@sadness ~] sudo vnconfig -l
vn0: covering /home/beket/lala.img on #B116:0x40006, inode 43367
vn1: not in use
vn2: not in use
vn3: covering /home/beket/foo.img on #B116:0x40006, inode 43380
vn4: not in use
vn5: not in use
vn6: not in use
vn7: not in use
vn8: not in use
vn9: not in use
vn10: not in use
vn11: not in use
[beket@sadness ~] rm lala.img
[beket@sadness ~] sudo vnconfig -l
vnconfig: ioctl: vn0: Invalid argument
[beket@sadness ~]

As mentioned before we are bitten twice: 1) we can't display the rest of the vn
entries (happens with every possible error) and 2) we get a broken message (in
this particular case).

Here is how vnconfig -l behaves with my patch:
[beket@sadness ~] sudo vnconfig -l
vn0: ioctl: can't access special filename
vn1: not in use
vn2: not in use
vn3: covering /home/beket/foo.img on #B116:0x40006, inode 43380
vn4: not in use
vn5: not in use
vn6: not in use
vn7: not in use
vn8: not in use
vn9: not in use
vn10: not in use
vn11: not in use
[beket@sadness ~]

Patch in:
http://stathisk.ath.cx/patches/dragonflybsd/0001-vnconfig-l-handle-gracefully-missing-special-file.patch

Please review.
Note: currently, vnconfig(8) is the only consumer of VNIOCGET/vnget(). Thus,
changing the return error of vnget() won't break anything (hoperfully:))

Best regards,
Stathis Kamperis

Actions #1

Updated by Anonymous over 15 years ago

Actually the exact error you get is:
[...]
[beket@sadness ~] rm lala.img
[beket@sadness ~] sudo vnconfig -l
vnconfig: ioctl: (null): Invalid argument

Actions #2

Updated by Anonymous over 15 years ago

Hi all.

I've found a less intrusive way to identify a failed vn_fullpath() call.

Patch in:
http://stathisk.ath.cx/patches/dragonflybsd/0001-vnconfig-l-handle-gracefully-missing-regular-file.patch

Please review.

Best regards,
Stathis Kamperis

Actions #4

Updated by swildner over 15 years ago

Thanks, committed!

Actions

Also available in: Atom PDF