Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Dec 2018 19:21:01 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r341681 - head/sys/cam/scsi
Message-ID:  <1f62c734-80fe-ca88-cf58-20c340463c8c@FreeBSD.org>
In-Reply-To: <CANCZdfqEkiCW_OwwdZjf5QTNTPq=inE5JtP5iitp62nKcUHteg@mail.gmail.com>
References:  <201812071202.wB7C2WT8038196@repo.freebsd.org> <CANCZdfqEkiCW_OwwdZjf5QTNTPq=inE5JtP5iitp62nKcUHteg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 07/12/2018 18:33, Warner Losh wrote:
> 
> 
> On Fri, Dec 7, 2018 at 5:02 AM Andriy Gapon <avg@freebsd.org
> <mailto:avg@freebsd.org>> 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.

My impression is that "the rest of the things" is not printed atomically,
unfortunately.  It would be great if it was.
For example, the printf that we see in the diff context above prints only
"Delete methods:" line.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1f62c734-80fe-ca88-cf58-20c340463c8c>