From owner-svn-src-all@freebsd.org Fri Dec 7 16:33:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18CF91312F02 for ; Fri, 7 Dec 2018 16:33:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D1D96CA71 for ; Fri, 7 Dec 2018 16:33:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82a.google.com with SMTP id n32so5074669qte.11 for ; Fri, 07 Dec 2018 08:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2hGJMlLBQODYjcxViExIo1narCBIwcm51BD43sGgPvI=; b=AsakdCcd2jJB6GitaTiCPfiAnHcu69fOKucviiiSboAMYRAtSspqHFU4qtPgb9aNhN yV0aH3NcxL3cPNm7nWpNl49DTMgOTKDkh7SykvrJuRR5uCuTWVNjpQQHKC3uVKMWmcd4 rsMIrLXyS1bayCbT+Nk5wzTY2mJKTk8AuAZNGAp7dW37y6b018xaGOmXY9V46gwRF3e2 bvHO3A+RkKqkX/gL7XitTCm/GOqDpOu56oGWCAgfr3fKgc6vW23gwzHjScEi9TkkCZTx dyajKwnDUzucufZ2pqTAGbTB1j/GV1qknDG0we64Yg++Y2L2xOmkUrQkXtBHBFy7uq04 a1dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2hGJMlLBQODYjcxViExIo1narCBIwcm51BD43sGgPvI=; b=sPsqqr2AO8xh8g4zWXFE/pbzZNM469X73W1lgQPLbVlEwqDyvxib3o/IfbUDM4aCd1 9e0gMbeK/dSw0xPmwLoD7rhKshL1gqwJfNRX9B53A4pQa5dmzH57KCYdG1aov6c1bguL SLE7unM20pEgKMy1i+3s/2V0OmXMHytUcqiRdu3/b89O8picWWRJ+6tIYJKdW9BtiJ0R FH96PsWaFKnT91SV6I8NSUZItuPdpF8QNXz5yqCVrA7BcCu53eMy3chXEkvoU9miB07F QftB/DSo032WQsPgLrNe3XVLcRZn1GDAx5MfU0USiMYX/gFWGyUiQdvuXRyZpGxxJpVw 4/Zw== X-Gm-Message-State: AA+aEWZWUX2O05S97dVj2AfMpB3HZ4qykoG9TOgyzokHqsVwAskvOb++ Dx9K29X1hN07O/9gPhIhI3Kz4fkWCrvKClH0DARqYA== X-Google-Smtp-Source: AFSGD/VtoeY8TgpeTVHrunYdnllm6vvgv4wTlKGcjGZpwXie88WyWgJ4Z3hbr1TjWSyotA0fF+ETl04lX5os5rtUgcE= X-Received: by 2002:a05:6214:1087:: with SMTP id o7mr2693191qvr.115.1544200420375; Fri, 07 Dec 2018 08:33:40 -0800 (PST) MIME-Version: 1.0 References: <201812071202.wB7C2WT8038196@repo.freebsd.org> In-Reply-To: <201812071202.wB7C2WT8038196@repo.freebsd.org> From: Warner Losh Date: Fri, 7 Dec 2018 09:33:28 -0700 Message-ID: Subject: Re: svn commit: r341681 - head/sys/cam/scsi To: Andriy Gapon Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 5D1D96CA71 X-Spamd-Result: default: False [-4.80 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[a.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.82)[ip: (-6.18), ipnet: 2607:f8b0::/32(-1.51), asn: 15169(-1.30), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2018 16:33:42 -0000 On Fri, Dec 7, 2018 at 5:02 AM Andriy Gapon wrote: > Author: avg > Date: Fri Dec 7 12:02:31 2018 > New Revision: 341681 > URL: https://svnweb.freebsd.org/changeset/base/341681 > > Log: > daprobedone: announce if a disk is write-protected > > MFC after: 2 weeks > > Modified: > head/sys/cam/scsi/scsi_da.c > > Modified: head/sys/cam/scsi/scsi_da.c > > ============================================================================== > --- head/sys/cam/scsi/scsi_da.c Fri Dec 7 11:47:42 2018 (r341680) > +++ head/sys/cam/scsi/scsi_da.c Fri Dec 7 12:02:31 2018 (r341681) > @@ -2472,6 +2472,11 @@ daprobedone(struct cam_periph *periph, union ccb > *ccb) > printf("%s%d: %s\n", periph->periph_name, > periph->unit_number, buf); > } > + if ((softc->disk->d_flags & DISKFLAG_WRITE_PROTECT) != 0 && > + (softc->flags & DA_FLAG_ANNOUNCED) == 0) { > + printf("%s%d: Write Protected\n", periph->periph_name, > + periph->unit_number); > + } > This is incorrect. It needs to be added to buf so that it gets printed atomically with the rest of things. Warner > /* > * Since our peripheral may be invalidated by an error > >