Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Nov 2009 01:02:06 +0100 (CET)
From:      Alexander Best <alexbestms@math.uni-muenster.de>
To:        <freebsd-current@FreeBSD.org>
Subject:   [patch] prevent burncd from failing when device is busy while trying to eject
Message-ID:  <permail-20091108000206f0889e8400007fe2-a_best01@message-id.uni-muenster.de>

next in thread | raw e-mail | index | archive | help
  This is a MIME encoded multipart message.

--+permail-20091108000206f0889e8400007fe2-a_best01+
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

this patch was submitted by Jaakko Heinonen in january, but didn't get
committed to HEAD yet.

when burncd is used in combination with the eject switch it doesn't care if
the device is busy or not. if eject doesn't succeed burncd fails with EIO.

the patch issues ATAPI_TEST_UNIT_READY by calling (ioctl(fd, CDIOCRESET). this
gets repeated as long as the device isn't busy anymore or a timeout is being
reached.

this patch depends upon the removal of a bogus privilege check in
sys/dev/ata/ata-cd.c

would be nice if somebody could commit both patches. they've been tested for
almost a year now and cause no breakage to occur.

they can also safely be merged to 8-stable.

in order to make it into 7- and 6-stable this other patch (bin/95979) has to
be mfc'ed to those branches first.

thanks in advance.
alex

--+permail-20091108000206f0889e8400007fe2-a_best01+
Content-Type: text/plain
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename="burncd.c.patch.txt"

SW5kZXg6IHVzci5zYmluL2J1cm5jZC9idXJuY2QuYwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB1c3Iuc2Jpbi9i
dXJuY2QvYnVybmNkLmMJKHJldmlzaW9uIDE5OTAxNikKKysrIHVzci5zYmluL2J1cm5jZC9idXJu
Y2QuYwkod29ya2luZyBjb3B5KQpAQCAtNjUsNiArNjUsNyBAQAogdm9pZCBkb19EQU8oaW50IGZk
LCBpbnQsIGludCk7CiB2b2lkIGRvX1RBTyhpbnQgZmQsIGludCwgaW50LCBpbnQpOwogdm9pZCBk
b19mb3J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oQ0RJT0NSRVNFVCkiKTsKKworCQl1c2xlZXAoNTAwICogMTAw
MCk7CisJCXRpbWVvdXQgLT0gNTAwOworCX0KKworICAgICAgICBlcnJ4KEVYX0lPRVJSLCAidGlt
ZWQgb3V0IHdoaWxlIHdhaXRpbmcgZm9yIHRoZSBkcml2ZSB0byBiZWNvbWUgcmVhZHkiKTsKK30K
KwogaW50CiB3cml0ZV9maWxlKGludCBmZCwgc3RydWN0IHRyYWNrX2luZm8gKnRyYWNrX2luZm8p
CiB7Cg==

--+permail-20091108000206f0889e8400007fe2-a_best01+
Content-Type: text/plain
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename="atapicd.c.patch.txt"

SW5kZXg6IHN5cy9kZXYvYXRhL2F0YXBpLWNkLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2Rldi9hdGEv
YXRhcGktY2QuYwkocmV2aXNpb24gMTk5MDE2KQorKysgc3lzL2Rldi9hdGEvYXRhcGktY2QuYwko
d29ya2luZyBjb3B5KQpAQCAtMjU2LDEzICsyNTYsNyBAQAogCWNkcC0+ZmxhZ3MgfD0gRl9MT0NL
RUQ7CiAJYnJlYWs7CiAKLSAgICAvKgotICAgICAqIFhYWFJXOiBXaHkgZG9lcyB0aGlzIHJlcXVp
cmUgcHJpdmlsZWdlPwotICAgICAqLwogICAgIGNhc2UgQ0RJT0NSRVNFVDoKLQllcnJvciA9IHBy
aXZfY2hlY2sodGQsIFBSSVZfRFJJVkVSKTsKLQlpZiAoZXJyb3IpCi0JICAgIGJyZWFrOwogCWVy
cm9yID0gYWNkX3Rlc3RfcmVhZHkoZGV2KTsKIAlicmVhazsKIAo=

--+permail-20091108000206f0889e8400007fe2-a_best01+--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-20091108000206f0889e8400007fe2-a_best01>