Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs

2019-09-03 Thread Yoshihiro Ota
It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to 
fail as the following with HEAD checked out under "/usr/obj/freebsd":

cc  -O2 -pipe   -DWITH_CASPER -I/usr/obj/freebsd/contrib/elftoolchain/libelftc -
I/usr/obj/freebsd/contrib/elftoolchain/common -g -MD  -MF.depend.strings.o 
-MTstrings.o -std=gnu99 -Qunused-arguments  -c 
/usr/obj/freebsd/contrib/elftoolchain/strings/strings.c -o strings.o
/usr/obj/freebsd/contrib/elftoolchain/strings/strings.c:198:55: error: use of 
undeclared identifier 'FA_OPEN'
fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
 ^
1 error generated.
*** [strings.o] Error code 1


It looks #include  cannot pick up header files from 
"lib/libcasper/services/cap_fileargs"

Hiro

Ed Maste  wrote:

> Author: emaste
> Date: Wed Apr 17 16:02:57 2019
> New Revision: 346315
> URL: https://svnweb.freebsd.org/changeset/base/346315
> 
> Log:
>   cap_fileargs: add fileargs_lstat service
>   
>   Add fileargs_lstat function to cap_fileargs casper service to be able to
>   lstat files while in capability mode.  It can only lstat files given in
>   fileargs_init.
>   
>   Submitted by:   Bora 〓zarslan 
>   Reviewed by:oshogbo, cem (partial)
>   MFC after:  3 weeks
>   Relnotes:   Yes
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D19548
> 
> Modified:
>   head/lib/libcasper/services/cap_fileargs/cap_fileargs.3
>   head/lib/libcasper/services/cap_fileargs/cap_fileargs.c
>   head/lib/libcasper/services/cap_fileargs/cap_fileargs.h
> 
> Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3
> ==
> --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.3   Wed Apr 17 
> 16:00:33
> 2019  (r346314) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3   
> Wed Apr
> 17 16:02:57 2019  (r346315) @@ -24,7 +24,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd November 12, 2018
> +.Dd April 17, 2019
>  .Dt CAP_FILEARGS 3
>  .Os
>  .Sh NAME
> @@ -33,6 +33,7 @@
>  .Nm fileargs_init ,
>  .Nm fileargs_initnv ,
>  .Nm fileargs_free ,
> +.Nm fileargs_lstat ,
>  .Nm fileargs_open ,
>  .Nm fileargs_fopen
>  .Nd "library for handling files in capability mode"
> @@ -43,9 +44,9 @@
>  .In libcasper.h
>  .In casper/cap_fileargs.h
>  .Ft "fileargs_t *"
> -.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" 
> "cap_rights_t *rightsp"
> +.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" 
> "cap_rights_t *rightsp"
> "int operations" .Ft "fileargs_t *"
> -.Fn fileargs_cinit "cap_channel_t *cas" "int argc" "char *argv[]" "int 
> flags" "mode_t mode"
> "cap_rights_t *rightsp" +.Fn fileargs_cinit "cap_channel_t *cas" "int argc" 
> "char *argv[]" "int
> flags" "mode_t mode" "cap_rights_t *rightsp" "int operations" .Ft "fileargs_t 
> *"
>  .Fn fileargs_cinitnv "cap_channel_t *cas" "nvlist_t *limits"
>  .Ft "fileargs_t *"
> @@ -53,6 +54,8 @@
>  .Ft "void"
>  .Fn fileargs_free "fileargs_t *fa"
>  .Ft "int"
> +.Fn fileargs_lstat "fileargs_t *fa" "const char *path" "struct stat *sb"
> +.Ft "int"
>  .Fn fileargs_open "fileargs_t *fa" "const char *name"
>  .Ft "FILE *"
>  .Fn fileargs_fopen "fileargs_t *fa" "const char *name" "const char *mode"
> @@ -97,6 +100,22 @@ The
>  argument contains a list of the capability rights which file should be 
> limited to.
>  For more details of the capability rights see
>  .Xr cap_rights_init 3 .
> +The
> +.Fa operations
> +argument limits the operations that are available using
> +.Nm system.fileargs .
> +.Fa operations
> +is a combination of:
> +.Bl -ohang -offset indent
> +.It FA_OPEN
> +Allow
> +.Fn fileargs_open
> +and
> +.Fn fileargs_fopen .
> +.It FA_LSTAT
> +Allow
> +.Fn fileargs_lstat .
> +.El
>  .Pp
>  The function
>  .Fn fileargs_cinit
> @@ -126,6 +145,11 @@ The function handle
>  .Dv NULL
>  argument.
>  .Pp
> +The function
> +.Fn fileargs_lstat
> +is equivalent to
> +.Xr lstat 2 .
> +.Pp
>  The functions
>  .Fn fileargs_open
>  and
> @@ -165,6 +189,15 @@ must contain the
>  The
>  .Va mode
>  argument tells which what mode file should be created.
> +.It operations (NV_TYPE_NUMBER)
> +The
> +.Va operations
> +limits the usable operations for
> +.Fa system.fileargs .
> +The possible values are explained as
> +.Va operations
> +argument with
> +.Fn fileargs_init .
>  .El
>  .Pp
>  The
> @@ -201,7 +234,7 @@ argv += optind;
>  
>  /* Create capability to the system.fileargs service. */
>  fa = fileargs_init(argc, argv, O_RDONLY, 0,
> -cap_rights_init(&rights, CAP_READ));
> +cap_rights_init(&rights, CAP_READ), FA_OPEN);
>  if (fa == NULL)
>   err(1, "unable to open system.fileargs service");
>  
> @@ -222,6 +255,7 @@ fileargs_free(fa);
>  .Ed
>  .Sh SEE ALSO
>  .Xr cap_enter 2 ,
> +.Xr lstat 2 ,
>  .Xr open 2 ,
>  .Xr cap_rights_init 3 ,
>  .Xr err 3 ,
> 
> Modified: head/lib/libca

Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs

2019-09-03 Thread Yoshihiro Ota
Hi Ed and thank you for taking a look.

my svn info says 346593 which is after few other fixes were commited.

I'm on i386 arch.
I haven't done installworld yet after picking up libcasper changes.
'make buildworld' works fine.
'make xdev-build' fails and I tried with both "arm" and "mips" for TARGET and 
TARGET_ARCH.
Both fail same way.
Please check your /usr/include/casper/ca_fileargs.h and I suspect that's where 
you pick up FA_OPEN.

I attached a log file this time.

Regards,
Hiro

On Tue, 23 Apr 2019 09:49:00 -0400
Ed Maste  wrote:

> On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota  wrote:
> >
> > It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to 
> > fail as the
> > following with HEAD checked out under "/usr/obj/freebsd":
> 
> Hello Hiro-san, sorry about that.
> 
> I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but
> it failed on the install as DESTDIR wasn't set and I ran as non-root).
> Just `make xdev-build` was successful though.
> 
> What version were you trying to build? There were (several) followup
> commits to address issues with the initial commit of cap_fileargs
> lstat support.
% svn info
Path: .
Working Copy Root Path: /usr/src
URL: https://svn0.us-east.freebsd.org/base/head
Relative URL: ^/head
Repository Root: https://svn0.us-east.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 346593
Node Kind: directory
Schedule: normal
Last Changed Author: wma
Last Changed Rev: 346593
Last Changed Date: 2019-04-23 02:36:32 -0400 (Tue, 23 Apr 2019)

% make xdev-build TARGET=mips TARGET_ARCH=mips
mkdir -p /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr
mtree -deUW -f /usr/src/etc/mtree/BSD.usr.dist  -p 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr >/dev/null
===> lib/clang/libllvmminimal (obj,all,install)
===> usr.bin/clang/llvm-tblgen (obj,all,install)
sh /usr/src/tools/install.sh  -s -o root -g wheel -m 555   llvm-tblgen 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/llvm-tblgen
sh /usr/src/tools/install.sh  -o root -g wheel -m 444  llvm-tblgen.debug 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/llvm-tblgen.debug
===> usr.bin/clang/clang-tblgen (obj,all,install)
sh /usr/src/tools/install.sh  -s -o root -g wheel -m 555   clang-tblgen 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/clang-tblgen
sh /usr/src/tools/install.sh  -o root -g wheel -m 444  clang-tblgen.debug 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/clang-tblgen.debug
===> gnu/usr.bin/gperf (obj,all,install)
sh /usr/src/tools/install.sh  -s -o root -g wheel -m 555   gperf 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/gperf
sh /usr/src/tools/install.sh  -o root -g wheel -m 444  gperf.debug 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/gperf.debug
===> lib/liby (obj,all,install)
sh /usr/src/tools/install.sh  -C -o root -g wheel -m 444   liby.a 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/
===> usr.bin/yacc (obj,all,install)
sh /usr/src/tools/install.sh  -s -o root -g wheel -m 555   yacc 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/yacc
sh /usr/src/tools/install.sh  -o root -g wheel -m 444  yacc.debug 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/yacc.debug
sh /usr/src/tools/install.sh -l h -o root -g wheel -m 555  
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/yacc 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/byacc
===> bin/csh (obj,build-tools)
===> bin/sh (obj,build-tools)
===> lib/ncurses/ncurses (obj,build-tools)
===> lib/ncurses/ncursesw (obj,build-tools)
===> share/syscons/scrnmaps (obj,build-tools)
===> usr.bin/awk (obj,build-tools)
===> lib/libmagic (obj,build-tools)
===> usr.bin/mkesdb_static (obj,build-tools)
===> usr.bin/mkcsmapper_static (obj,build-tools)
===> usr.bin/vi/catalog (obj,build-tools)
===> gnu/usr.bin/cc/cc_tools (obj,build-tools)
===> xdev gnu/usr.bin/binutils (obj,all)
===> gnu/usr.bin/binutils/libiberty (all)
===> gnu/usr.bin/binutils/libbfd (all)
===> gnu/usr.bin/binutils/libopcodes (all)
===> gnu/usr.bin/binutils/doc (all)
===> gnu/usr.bin/binutils/libbinutils (all)
===> gnu/usr.bin/binutils/as (all)
===> gnu/usr.bin/binutils/objdump (all)
===> gnu/usr.bin/binutils/ld (all)
===> xdev lib/libelftc (obj,all)
===> xdev lib/libpe (obj,all)
===> xdev usr.bin/objcopy (obj,all)
===> xdev usr.bin/nm (obj,all)
===> xdev usr.bin/size (obj,all)
===> xdev usr.bin/strings (obj,all)
cc  -O2 -pipe   -DWITH_CASPER -I/usr/src/contrib/elftoolchain/libelftc 
-I/usr/src/contrib/elftoolchain/common -g -MD  -MF.depend.strings.o 
-MTstrings.o -std=gnu99 -Qunused-arguments  -c 
/usr/src/contrib/elftoolchain/strings/strings.c -o strings.o
/usr/src/contrib/elftoolchain/strings/strings.c:198:55: erro

Re: svn commit: r345804 - head/usr.bin/systat

2019-09-03 Thread Yoshihiro Ota
Hi,

On Tue, 2 Apr 2019 07:08:17 -0700 (PDT)
"Rodney W. Grimes"  wrote:

> > Author: mr
> > Date: Tue Apr  2 14:01:03 2019
> > New Revision: 345804
> > URL: https://svnweb.freebsd.org/changeset/base/345804
> > 
> > Log:
> >   systat -zarc to display disk activities like -vm
> >   
> >   PR:   213310
> >   Submitted by: ota
> >   MFH:  4 weeks
> 
> ? MFC:
> 
> >   Differential Revision:https://reviews.freebsd.org/D18726
> > 
> > Modified:
> >   head/usr.bin/systat/devs.c
> >   head/usr.bin/systat/devs.h
> >   head/usr.bin/systat/iostat.c
> >   head/usr.bin/systat/swap.c
> >   head/usr.bin/systat/systat.h
> >   head/usr.bin/systat/vmstat.c
> >   head/usr.bin/systat/zarc.c
> > 
> > Modified: head/usr.bin/systat/devs.c
> > ==
> > --- head/usr.bin/systat/devs.c  Tue Apr  2 13:59:04 2019
> > (r345803)
> > +++ head/usr.bin/systat/devs.c  Tue Apr  2 14:01:03 2019    
> > (r345804)
> > @@ -2,6 +2,7 @@
> >   * SPDX-License-Identifier: BSD-3-Clause
> >   *
> >   * Copyright (c) 1998 Kenneth D. Merry.
> > + *   2015 Yoshihiro Ota
> >   * All rights reserved.
> 
> 
> Can we get in contact with Yoshihiro Ota about his
> copyright statements, and correcting this to make
> it clear that it is Kenneth D. Merry that is asserting
> "All rights reserved" and if Ota does nor does not wish to assert
> "All rights reserved".
> 
> As committed this makes a grey area on Kenneth's assertion,
> also leaving out the word copyright on Yoshihiro's line is a bit iffy.
> 
> I am only commenting once, this issue appears several times.
> We can go back out to D18726 to discuss it if need be.

I've fully written zarc.c (and copied copy-right section from another file)
but all other changes in other files are refactoring and adjustments.

I don't know the policy/procedure of how to update copy right section of 
FreeBSD.
Please adjust them according the project.

Regards,
Hiro


___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r348261 - in stable/11: contrib/zlib lib/libz stand/libsa usr.bin/minigzip

2019-05-27 Thread Yoshihiro Ota
Hi Xin,

I didn't think we would have time for this to hit 11.3 release.

Next important one is the crc32 one.
Unless we do this split, we will need a special aid to work-around zlib/zlib.h 
compile error and also zib/crc32.c won't compile at all.

Regards,
Hiro

On Sat, 25 May 2019 01:58:00 + (UTC)
Xin LI  wrote:

> Author: delphij
> Date: Sat May 25 01:58:00 2019
> New Revision: 348261
> URL: https://svnweb.freebsd.org/changeset/base/348261
> 
> Log:
>   MFC r347244:
>   
>   Move contrib/zlib to sys/contrib/zlib so that we can use it in kernel.
>   This is a prerequisite of unifying kernel zlib instances.
>   
>   Submitted by:   Yoshihiro Ota 
>   Approved by:re (kib)
> 
> Added:
>  - copied from r347244, head/sys/contrib/zlib/
> Directory Properties:
>   stable/11/sys/contrib/zlib/   (props changed)
> Deleted:
>   stable/11/contrib/zlib/
> Modified:
>   stable/11/lib/libz/FREEBSD-upgrade
>   stable/11/lib/libz/Makefile
>   stable/11/stand/libsa/Makefile
>   stable/11/usr.bin/minigzip/Makefile
> Directory Properties:
>   stable/11/   (props changed)
> 
> Modified: stable/11/lib/libz/FREEBSD-upgrade
> ==
> --- stable/11/lib/libz/FREEBSD-upgradeSat May 25 00:22:07 2019
> (r348260)
> +++ stable/11/lib/libz/FREEBSD-upgradeSat May 25 01:58:00 2019
> (r348261)
> @@ -8,7 +8,7 @@ benefit other consumers.
>  To Update:
>1) Unpack vendor sources into a clean directory.
>2) Import onto the vendor area.
> -  3) Merge the vendor tree to contrib/zlib, which contains a stripped down
> +  3) Merge the vendor tree to sys/contrib/zlib, which contains a stripped 
> down
>   version of upstream source, resolve any conflicts.
>4) Double check zconf.h, zlib.pc, and Symbol.map to make sure that we
>   have the required changes.  Test universe and commit them.
> 
> Modified: stable/11/lib/libz/Makefile
> ==
> --- stable/11/lib/libz/Makefile   Sat May 25 00:22:07 2019
> (r348260)
> +++ stable/11/lib/libz/Makefile   Sat May 25 01:58:00 2019
> (r348261)
> @@ -8,7 +8,7 @@ SHLIBDIR?=/lib
>  SHLIB_MAJOR= 6
>  MAN= zlib.3 zopen.3
>  
> -ZLIBSRC= ${SRCTOP}/contrib/zlib
> +ZLIBSRC= ${SRCTOP}/sys/contrib/zlib
>  
>  .PATH:   ${ZLIBSRC}
>  
> 
> Modified: stable/11/stand/libsa/Makefile
> ==
> --- stable/11/stand/libsa/MakefileSat May 25 00:22:07 2019
> (r348260)
> +++ stable/11/stand/libsa/MakefileSat May 25 01:58:00 2019
> (r348261)
> @@ -99,8 +99,8 @@ CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
>  SRCS+=bzlib.c crctable.c decompress.c huffman.c randtable.c
>  
>  # decompression functionality from zlib
> -.PATH: ${SRCTOP}/contrib/zlib
> -CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/contrib/zlib
> +.PATH: ${SRCTOP}/sys/contrib/zlib
> +CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
>  SRCS+=   adler32.c crc32.c
>  SRCS+=   infback.c inffast.c inflate.c inftrees.c zutil.c
>  
> 
> Modified: stable/11/usr.bin/minigzip/Makefile
> ==
> --- stable/11/usr.bin/minigzip/Makefile   Sat May 25 00:22:07 2019
> (r348260)
> +++ stable/11/usr.bin/minigzip/Makefile   Sat May 25 01:58:00 2019
> (r348261)
> @@ -1,6 +1,6 @@
>  # $FreeBSD$
>  
> -SRCDIR=  ${SRCTOP}/contrib/zlib/test
> +SRCDIR=  ${SRCTOP}/sys/contrib/zlib/test
>  .PATH:   ${SRCDIR}
>  
>  PROG=minigzip
> ___
> svn-src-all@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r347968 - head/sys/kern

2019-05-19 Thread Yoshihiro Ota
Hi Konstantin,

I coundn't remount ro->rw a few days ago.
This change isn't related, then.
I will check/tesst it again later, then.

Thanks,
Hiro

On Sun, 19 May 2019 20:51:04 +0300
Konstantin Belousov  wrote:

> On Sun, May 19, 2019 at 11:52:28AM -0400, Yoshihiro Ota wrote:
> > Hi,
> > 
> > Does this change fix 'mount -u -rw /path' to remount read-only device with 
> > write mode?
> > I moticed an issue a couple of days ago but didn't have time to conform nor 
> > report.
> 
> I do not understand your description.  If you mean does this commit has
> any relevance to the issue of remounting ro->rw, it should not.  It only
> affects rw->ro remounts, when you have a binary executed from the mount
> point.
> 
> > 
> > Thanks,
> > Hiro
> > 
> > On Sun, 19 May 2019 09:18:10 + (UTC)
> > Konstantin Belousov  wrote:
> > 
> > > Author: kib
> > > Date: Sun May 19 09:18:09 2019
> > > New Revision: 347968
> > > URL: https://svnweb.freebsd.org/changeset/base/347968
> > > 
> > > Log:
> > >   Fix rw->ro remount when there is a text vnode mapping.
> > >   
> > >   Reported and tested by: hrs
> > >   Sponsored by:   The FreeBSD Foundation
> > >   MFC after:  16 days
> > > 
> > > Modified:
> > >   head/sys/kern/vfs_subr.c
> > > 
> > > Modified: head/sys/kern/vfs_subr.c
> > > ==
> > > --- head/sys/kern/vfs_subr.c  Sun May 19 06:01:11 2019
> > > (r347967)
> > > +++ head/sys/kern/vfs_subr.c  Sun May 19 09:18:09 2019
> > > (r347968)
> > > @@ -3146,7 +3146,7 @@ loop:
> > >  
> > >   if ((vp->v_type == VNON ||
> > >   (error == 0 && vattr.va_nlink > 0)) &&
> > > - (vp->v_writecount == 0 || vp->v_type != VREG)) {
> > > + (vp->v_writecount <= 0 || vp->v_type != VREG)) {
> > >   VOP_UNLOCK(vp, 0);
> > >   vdropl(vp);
> > >   continue;
> > > ___
> > > svn-src-all@freebsd.org mailing list
> > > https://lists.freebsd.org/mailman/listinfo/svn-src-all
> > > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r347968 - head/sys/kern

2019-05-19 Thread Yoshihiro Ota
Hi,

Does this change fix 'mount -u -rw /path' to remount read-only device with 
write mode?
I moticed an issue a couple of days ago but didn't have time to conform nor 
report.

Thanks,
Hiro

On Sun, 19 May 2019 09:18:10 + (UTC)
Konstantin Belousov  wrote:

> Author: kib
> Date: Sun May 19 09:18:09 2019
> New Revision: 347968
> URL: https://svnweb.freebsd.org/changeset/base/347968
> 
> Log:
>   Fix rw->ro remount when there is a text vnode mapping.
>   
>   Reported and tested by: hrs
>   Sponsored by:   The FreeBSD Foundation
>   MFC after:  16 days
> 
> Modified:
>   head/sys/kern/vfs_subr.c
> 
> Modified: head/sys/kern/vfs_subr.c
> ==
> --- head/sys/kern/vfs_subr.c  Sun May 19 06:01:11 2019(r347967)
> +++ head/sys/kern/vfs_subr.c  Sun May 19 09:18:09 2019(r347968)
> @@ -3146,7 +3146,7 @@ loop:
>  
>   if ((vp->v_type == VNON ||
>   (error == 0 && vattr.va_nlink > 0)) &&
> - (vp->v_writecount == 0 || vp->v_type != VREG)) {
> + (vp->v_writecount <= 0 || vp->v_type != VREG)) {
>   VOP_UNLOCK(vp, 0);
>   vdropl(vp);
>   continue;
> ___
> svn-src-all@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r347951 - stable/12/lib/libc/stdlib

2019-05-19 Thread Yoshihiro Ota
I wonder if we can use a tool to confirm coding style like
clang-format or something else.

I tried to setup clang-format and 2 others in the past like
a year ago but wasn't able to do...

Hiro


On Sat, 18 May 2019 06:06:51 -0700 (PDT)
"Rodney W. Grimes"  wrote:

> > Hello Konstantin and Bruce,
> > 
> > thank you for your comments. Clearly, this should have been addressed in
> > the review and checked by a second pair of eyes. I mostly did the man
> > page changes and can't comment much on the actual coding example. Two
> > people (dab and jilles) approved the revision in the Phabricator review.
> > There was plenty of time to review it between April 16 and May 15 when
> > then the original submitter asked if there was anything else that needs
> > to be done.
> 
> The quality of a code review is highly dependent on who is invited
> to do the reviewing, and how much participation and care those invited
> have with respect to the process.  Man pages that contain code samples
> need to have more reviewers, you need man page experts, you need subject
> mater experts, and you need coding experts.  This review could of used
> more reviewers (hind sight is 20/20) but if they had not been the right
> reviewers the low quality commit would of probably still occurred.
> 
> The amount of time in review is not a good measure of review completness,
> that falls more onto the quality of the workmanship of those actually
> commented on a review.  I myself consider a LGTM, or a accept by a reviewer
> who makes 0 comments on my code in phab as if that reviewer probably
> just rubber stamped my change, UNLESS I have extremly high trust in
> that person.  If bde, imp, or kib stamp an approve on something of mine my
> confidence level is very high and I do consider that code well reviewed,
> if I get a rubber stamp from some others I am not so confident.
> 
> Now we have the problem in that note every code review can be done by
> such high quality engineers due to time and work load constraints, so
> we need to raise the level of others closer to these shinning stars
> and offset this lack of avaliable resources by other means (more
> reviewers, long review cycles, automations, etc.)
> > 
> > Now, having said that and the the change is now both in HEAD and
> > stable/12, how do we proceed? Revert them both or patch those issues as
> > follow-ups? Note that a src committer should do that and not me trying
> > to add more EXAMPLE sections to man pages with my doc commit bit.
> 
> There is another option, a revert is actually a local operation
> to your checked out code, ou can check out head, revert this
> commit, but do not commit, make the corrections, and then commit.
> 
> When MFC's this single commit does the right thing.
> 
> You could also revert in head, commit and later fix these
> issues, commit, and then MFC both of those commits.
> 
> All of your proposed solutions, and my additions are workable,
> and I really have no preference on a single file change like
> this.
> 
> Good Day,
> Rod
> 
> > Regards,
> > Benedict
> > 
> > 
> > 
> > Am 18.05.19 um 07:45 schrieb Bruce Evans:
> > > On Sat, 18 May 2019, Konstantin Belousov wrote:
> > > 
> > >> On Sat, May 18, 2019 at 03:15:08AM +, Benedict Reuschling wrote:
> > >>> Author: bcr (doc committer)
> > >>> Date: Sat May 18 03:15:07 2019
> > >>> New Revision: 347951
> > >>> URL: https://svnweb.freebsd.org/changeset/base/347951
> > >>>
> > >>> Log:
> > >>> ? MFC r347617:
> > >>> ? Add small EXAMPLE section to bsearch.3.
> > >>>
> > >>> ? Submitted by:??? fernape (via Phabricator)
> > >>> ? Reviewed by:??? bcr, jilles, dab
> > >>> ? Approved by:??? bcr (man pages), jilles (src)
> > >>> ? Differential Revision:??? https://reviews.freebsd.org/D19902
> > >>>
> > >>> Modified:
> > >>> ? stable/12/lib/libc/stdlib/bsearch.3
> > >>> Directory Properties:
> > >>> ? stable/12/?? (props changed)
> > >>>
> > >>> Modified: stable/12/lib/libc/stdlib/bsearch.3
> > >>> ==
> > >>>
> > >>> --- stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 02:02:14
> > >>> 2019??? (r347950)
> > >>> +++ stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 03:15:07
> > >>> 2019??? (r347951)
> > >>> @@ -32,7 +32,7 @@
> > >>> ?.\" @(#)bsearch.3??? 8.3 (Berkeley) 4/19/94
> > >>> ?.\" $FreeBSD$
> > >>> ?.\"
> > >>> -.Dd February 22, 2013
> > >>> +.Dd May 15, 2019
> > >>> ?.Dt BSEARCH 3
> > >>> ?.Os
> > >>> ?.Sh NAME
> > >>> @@ -83,6 +83,61 @@ The
> > >>> ?function returns a pointer to a matching member of the array, or a null
> > >>> ?pointer if no match is found.
> > >>> ?If two members compare as equal, which member is matched is
> > >>> unspecified.
> > >>> +.Sh EXAMPLES
> > >>> +A sample program that searches people by age in a sorted array:
> > >>> +.Bd -literal
> > >>> +#include 
> > >>> +#include 
> > >>> +#include 
> > >>> +#include 
> > >>> +#include 
> > >>> +
> > >>> +struct person {
> > >>> +?

Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs

2019-04-30 Thread Yoshihiro Ota
I looked into this more.

I started wondering if "xdev" has been obsolete after 
/usr/obj/. dir chaneg.

Both of these commands worked okay:
% make kernel-toolchain kernel TARGET_ARCH=mips KERNCONF=PB92 -C /usr/src
% make buildworld TARGET_ARCH=arm -C /usr/src

While I kept getting compile errors by:
% make xdev-build TARGET_ARCH=mips TARGET=mips -C /usr/src

In other words, if I don't run explict xdev command, buildworld and buildkernel
compile okay.

Hiro


On Wed, 24 Apr 2019 00:24:34 -0400
Yoshihiro Ota  wrote:

> Hi Ed and thank you for taking a look.
> 
> my svn info says 346593 which is after few other fixes were commited.
> 
> I'm on i386 arch.
> I haven't done installworld yet after picking up libcasper changes.
> 'make buildworld' works fine.
> 'make xdev-build' fails and I tried with both "arm" and "mips" for TARGET and 
> TARGET_ARCH.
> Both fail same way.
> Please check your /usr/include/casper/ca_fileargs.h and I suspect that's 
> where you pick up
> FA_OPEN.
> 
> I attached a log file this time.
> 
> Regards,
> Hiro
> 
> On Tue, 23 Apr 2019 09:49:00 -0400
> Ed Maste  wrote:
> 
> > On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota  wrote:
> > >
> > > It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' 
> > > to fail as the
> > > following with HEAD checked out under "/usr/obj/freebsd":
> > 
> > Hello Hiro-san, sorry about that.
> > 
> > I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but
> > it failed on the install as DESTDIR wasn't set and I ran as non-root).
> > Just `make xdev-build` was successful though.
> > 
> > What version were you trying to build? There were (several) followup
> > commits to address issues with the initial commit of cap_fileargs
> > lstat support.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs

2019-04-23 Thread Yoshihiro Ota
Hi Ed and thank you for taking a look.

my svn info says 346593 which is after few other fixes were commited.

I'm on i386 arch.
I haven't done installworld yet after picking up libcasper changes.
'make buildworld' works fine.
'make xdev-build' fails and I tried with both "arm" and "mips" for TARGET and 
TARGET_ARCH.
Both fail same way.
Please check your /usr/include/casper/ca_fileargs.h and I suspect that's where 
you pick up FA_OPEN.

I attached a log file this time.

Regards,
Hiro

On Tue, 23 Apr 2019 09:49:00 -0400
Ed Maste  wrote:

> On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota  wrote:
> >
> > It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to 
> > fail as the
> > following with HEAD checked out under "/usr/obj/freebsd":
> 
> Hello Hiro-san, sorry about that.
> 
> I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but
> it failed on the install as DESTDIR wasn't set and I ran as non-root).
> Just `make xdev-build` was successful though.
> 
> What version were you trying to build? There were (several) followup
> commits to address issues with the initial commit of cap_fileargs
> lstat support.
% svn info
Path: .
Working Copy Root Path: /usr/src
URL: https://svn0.us-east.freebsd.org/base/head
Relative URL: ^/head
Repository Root: https://svn0.us-east.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 346593
Node Kind: directory
Schedule: normal
Last Changed Author: wma
Last Changed Rev: 346593
Last Changed Date: 2019-04-23 02:36:32 -0400 (Tue, 23 Apr 2019)

% make xdev-build TARGET=mips TARGET_ARCH=mips
mkdir -p /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr
mtree -deUW -f /usr/src/etc/mtree/BSD.usr.dist  -p 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr >/dev/null
===> lib/clang/libllvmminimal (obj,all,install)
===> usr.bin/clang/llvm-tblgen (obj,all,install)
sh /usr/src/tools/install.sh  -s -o root -g wheel -m 555   llvm-tblgen 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/llvm-tblgen
sh /usr/src/tools/install.sh  -o root -g wheel -m 444  llvm-tblgen.debug 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/llvm-tblgen.debug
===> usr.bin/clang/clang-tblgen (obj,all,install)
sh /usr/src/tools/install.sh  -s -o root -g wheel -m 555   clang-tblgen 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/clang-tblgen
sh /usr/src/tools/install.sh  -o root -g wheel -m 444  clang-tblgen.debug 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/clang-tblgen.debug
===> gnu/usr.bin/gperf (obj,all,install)
sh /usr/src/tools/install.sh  -s -o root -g wheel -m 555   gperf 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/gperf
sh /usr/src/tools/install.sh  -o root -g wheel -m 444  gperf.debug 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/gperf.debug
===> lib/liby (obj,all,install)
sh /usr/src/tools/install.sh  -C -o root -g wheel -m 444   liby.a 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/
===> usr.bin/yacc (obj,all,install)
sh /usr/src/tools/install.sh  -s -o root -g wheel -m 555   yacc 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/yacc
sh /usr/src/tools/install.sh  -o root -g wheel -m 444  yacc.debug 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/yacc.debug
sh /usr/src/tools/install.sh -l h -o root -g wheel -m 555  
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/yacc 
/usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/byacc
===> bin/csh (obj,build-tools)
===> bin/sh (obj,build-tools)
===> lib/ncurses/ncurses (obj,build-tools)
===> lib/ncurses/ncursesw (obj,build-tools)
===> share/syscons/scrnmaps (obj,build-tools)
===> usr.bin/awk (obj,build-tools)
===> lib/libmagic (obj,build-tools)
===> usr.bin/mkesdb_static (obj,build-tools)
===> usr.bin/mkcsmapper_static (obj,build-tools)
===> usr.bin/vi/catalog (obj,build-tools)
===> gnu/usr.bin/cc/cc_tools (obj,build-tools)
===> xdev gnu/usr.bin/binutils (obj,all)
===> gnu/usr.bin/binutils/libiberty (all)
===> gnu/usr.bin/binutils/libbfd (all)
===> gnu/usr.bin/binutils/libopcodes (all)
===> gnu/usr.bin/binutils/doc (all)
===> gnu/usr.bin/binutils/libbinutils (all)
===> gnu/usr.bin/binutils/as (all)
===> gnu/usr.bin/binutils/objdump (all)
===> gnu/usr.bin/binutils/ld (all)
===> xdev lib/libelftc (obj,all)
===> xdev lib/libpe (obj,all)
===> xdev usr.bin/objcopy (obj,all)
===> xdev usr.bin/nm (obj,all)
===> xdev usr.bin/size (obj,all)
===> xdev usr.bin/strings (obj,all)
cc  -O2 -pipe   -DWITH_CASPER -I/usr/src/contrib/elftoolchain/libelftc 
-I/usr/src/contrib/elftoolchain/common -g -MD  -MF.depend.strings.o 
-MTstrings.o -std=gnu99 -Qunused-arguments  -c 
/usr/src/contrib/elftoolchain/strings/strings.c -o strings.o
/usr/src/contrib/elftoolchain/strings/strings.c:198:55: erro

Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs

2019-04-22 Thread Yoshihiro Ota
It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to 
fail as the following with HEAD checked out under "/usr/obj/freebsd":

cc  -O2 -pipe   -DWITH_CASPER -I/usr/obj/freebsd/contrib/elftoolchain/libelftc -
I/usr/obj/freebsd/contrib/elftoolchain/common -g -MD  -MF.depend.strings.o 
-MTstrings.o -std=gnu99 -Qunused-arguments  -c 
/usr/obj/freebsd/contrib/elftoolchain/strings/strings.c -o strings.o
/usr/obj/freebsd/contrib/elftoolchain/strings/strings.c:198:55: error: use of 
undeclared identifier 'FA_OPEN'
fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);
 ^
1 error generated.
*** [strings.o] Error code 1


It looks #include  cannot pick up header files from 
"lib/libcasper/services/cap_fileargs"

Hiro

Ed Maste  wrote:

> Author: emaste
> Date: Wed Apr 17 16:02:57 2019
> New Revision: 346315
> URL: https://svnweb.freebsd.org/changeset/base/346315
> 
> Log:
>   cap_fileargs: add fileargs_lstat service
>   
>   Add fileargs_lstat function to cap_fileargs casper service to be able to
>   lstat files while in capability mode.  It can only lstat files given in
>   fileargs_init.
>   
>   Submitted by:   Bora 〓zarslan 
>   Reviewed by:oshogbo, cem (partial)
>   MFC after:  3 weeks
>   Relnotes:   Yes
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D19548
> 
> Modified:
>   head/lib/libcasper/services/cap_fileargs/cap_fileargs.3
>   head/lib/libcasper/services/cap_fileargs/cap_fileargs.c
>   head/lib/libcasper/services/cap_fileargs/cap_fileargs.h
> 
> Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3
> ==
> --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.3   Wed Apr 17 
> 16:00:33
> 2019  (r346314) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3   
> Wed Apr
> 17 16:02:57 2019  (r346315) @@ -24,7 +24,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd November 12, 2018
> +.Dd April 17, 2019
>  .Dt CAP_FILEARGS 3
>  .Os
>  .Sh NAME
> @@ -33,6 +33,7 @@
>  .Nm fileargs_init ,
>  .Nm fileargs_initnv ,
>  .Nm fileargs_free ,
> +.Nm fileargs_lstat ,
>  .Nm fileargs_open ,
>  .Nm fileargs_fopen
>  .Nd "library for handling files in capability mode"
> @@ -43,9 +44,9 @@
>  .In libcasper.h
>  .In casper/cap_fileargs.h
>  .Ft "fileargs_t *"
> -.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" 
> "cap_rights_t *rightsp"
> +.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" 
> "cap_rights_t *rightsp"
> "int operations" .Ft "fileargs_t *"
> -.Fn fileargs_cinit "cap_channel_t *cas" "int argc" "char *argv[]" "int 
> flags" "mode_t mode"
> "cap_rights_t *rightsp" +.Fn fileargs_cinit "cap_channel_t *cas" "int argc" 
> "char *argv[]" "int
> flags" "mode_t mode" "cap_rights_t *rightsp" "int operations" .Ft "fileargs_t 
> *"
>  .Fn fileargs_cinitnv "cap_channel_t *cas" "nvlist_t *limits"
>  .Ft "fileargs_t *"
> @@ -53,6 +54,8 @@
>  .Ft "void"
>  .Fn fileargs_free "fileargs_t *fa"
>  .Ft "int"
> +.Fn fileargs_lstat "fileargs_t *fa" "const char *path" "struct stat *sb"
> +.Ft "int"
>  .Fn fileargs_open "fileargs_t *fa" "const char *name"
>  .Ft "FILE *"
>  .Fn fileargs_fopen "fileargs_t *fa" "const char *name" "const char *mode"
> @@ -97,6 +100,22 @@ The
>  argument contains a list of the capability rights which file should be 
> limited to.
>  For more details of the capability rights see
>  .Xr cap_rights_init 3 .
> +The
> +.Fa operations
> +argument limits the operations that are available using
> +.Nm system.fileargs .
> +.Fa operations
> +is a combination of:
> +.Bl -ohang -offset indent
> +.It FA_OPEN
> +Allow
> +.Fn fileargs_open
> +and
> +.Fn fileargs_fopen .
> +.It FA_LSTAT
> +Allow
> +.Fn fileargs_lstat .
> +.El
>  .Pp
>  The function
>  .Fn fileargs_cinit
> @@ -126,6 +145,11 @@ The function handle
>  .Dv NULL
>  argument.
>  .Pp
> +The function
> +.Fn fileargs_lstat
> +is equivalent to
> +.Xr lstat 2 .
> +.Pp
>  The functions
>  .Fn fileargs_open
>  and
> @@ -165,6 +189,15 @@ must contain the
>  The
>  .Va mode
>  argument tells which what mode file should be created.
> +.It operations (NV_TYPE_NUMBER)
> +The
> +.Va operations
> +limits the usable operations for
> +.Fa system.fileargs .
> +The possible values are explained as
> +.Va operations
> +argument with
> +.Fn fileargs_init .
>  .El
>  .Pp
>  The
> @@ -201,7 +234,7 @@ argv += optind;
>  
>  /* Create capability to the system.fileargs service. */
>  fa = fileargs_init(argc, argv, O_RDONLY, 0,
> -cap_rights_init(&rights, CAP_READ));
> +cap_rights_init(&rights, CAP_READ), FA_OPEN);
>  if (fa == NULL)
>   err(1, "unable to open system.fileargs service");
>  
> @@ -222,6 +255,7 @@ fileargs_free(fa);
>  .Ed
>  .Sh SEE ALSO
>  .Xr cap_enter 2 ,
> +.Xr lstat 2 ,
>  .Xr open 2 ,
>  .Xr cap_rights_init 3 ,
>  .Xr err 3 ,
> 
> Modified: head/lib/libca

Re: svn commit: r345804 - head/usr.bin/systat

2019-04-02 Thread Yoshihiro Ota
Hi,

On Tue, 2 Apr 2019 07:08:17 -0700 (PDT)
"Rodney W. Grimes"  wrote:

> > Author: mr
> > Date: Tue Apr  2 14:01:03 2019
> > New Revision: 345804
> > URL: https://svnweb.freebsd.org/changeset/base/345804
> > 
> > Log:
> >   systat -zarc to display disk activities like -vm
> >   
> >   PR:   213310
> >   Submitted by: ota
> >   MFH:  4 weeks
> 
> ? MFC:
> 
> >   Differential Revision:https://reviews.freebsd.org/D18726
> > 
> > Modified:
> >   head/usr.bin/systat/devs.c
> >   head/usr.bin/systat/devs.h
> >   head/usr.bin/systat/iostat.c
> >   head/usr.bin/systat/swap.c
> >   head/usr.bin/systat/systat.h
> >   head/usr.bin/systat/vmstat.c
> >   head/usr.bin/systat/zarc.c
> > 
> > Modified: head/usr.bin/systat/devs.c
> > ==
> > --- head/usr.bin/systat/devs.c  Tue Apr  2 13:59:04 2019
> > (r345803)
> > +++ head/usr.bin/systat/devs.c  Tue Apr  2 14:01:03 2019    
> > (r345804)
> > @@ -2,6 +2,7 @@
> >   * SPDX-License-Identifier: BSD-3-Clause
> >   *
> >   * Copyright (c) 1998 Kenneth D. Merry.
> > + *   2015 Yoshihiro Ota
> >   * All rights reserved.
> 
> 
> Can we get in contact with Yoshihiro Ota about his
> copyright statements, and correcting this to make
> it clear that it is Kenneth D. Merry that is asserting
> "All rights reserved" and if Ota does nor does not wish to assert
> "All rights reserved".
> 
> As committed this makes a grey area on Kenneth's assertion,
> also leaving out the word copyright on Yoshihiro's line is a bit iffy.
> 
> I am only commenting once, this issue appears several times.
> We can go back out to D18726 to discuss it if need be.

I've fully written zarc.c (and copied copy-right section from another file)
but all other changes in other files are refactoring and adjustments.

I don't know the policy/procedure of how to update copy right section of 
FreeBSD.
Please adjust them according the project.

Regards,
Hiro
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r342375 - head/sys/dev/md

2018-12-23 Thread Yoshihiro Ota
Thanks.

I noticed when this was broken upon a new release long time ago but couldn't 
get any clue nor when this was broken (since I hadn't started following 
trunk/stable back then.)

Was that 7.0-RELEASE or 8.0-RELEASE?

Anyway, good news and I will try to bring this to local 12.0-RELEASE.

Regards,
Hiro

On Sat, 22 Dec 2018 22:59:11 + (UTC)
Bruce Evans  wrote:

> Author: bde
> Date: Sat Dec 22 22:59:11 2018
> New Revision: 342375
> URL: https://svnweb.freebsd.org/changeset/base/342375
> 
> Log:
>   Fix devstat on md devices, second attempt.  r341765 depends on
>   g_io_deliver() finishing initialization of the bio, but g_io_deliver()
>   actually destroys the bio.  INVARIANTS makes the bug obvious by
>   overwriting the bio with garbage.
>   
>   Restore the old order for calling devstat (except don't restore not calling
>   it for the error case), and translate to the devstat KPI so that this order
>   works.
>   
>   Reviewed by:kib
> 
> Modified:
>   head/sys/dev/md/md.c
> 
> Modified: head/sys/dev/md/md.c
> ==
> --- head/sys/dev/md/md.c  Sat Dec 22 21:49:25 2018(r342374)
> +++ head/sys/dev/md/md.c  Sat Dec 22 22:59:11 2018(r342375)
> @@ -1241,12 +1241,22 @@ md_kthread(void *arg)
>   error = sc->start(sc, bp);
>   }
>  
> + if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) {
> + /*
> +  * Devstat uses (bio_bcount, bio_resid) for
> +  * determining the length of the completed part of
> +  * the i/o.  g_io_deliver() will translate from
> +  * bio_completed to that, but it also destroys the
> +  * bio so we must do our own translation.
> +  */
> + bp->bio_bcount = bp->bio_length;
> + bp->bio_resid = (error == -1 ? bp->bio_bcount : 0);
> + devstat_end_transaction_bio(sc->devstat, bp);
> + }
>   if (error != -1) {
>   bp->bio_completed = bp->bio_length;
>   g_io_deliver(bp, error);
>   }
> - if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)
> - devstat_end_transaction_bio(sc->devstat, bp);
>   }
>  }
>  
> ___
> svn-src-all@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r202708 - head/sys/fs/tmpfs

2010-01-20 Thread Yoshihiro Ota
On Wed, 20 Jan 2010 18:50:58 +0100
"Ronald Klop"  wrote:

> On Wed, 20 Jan 2010 18:34:37 +0100, Ivan Voras  wrote:
> 
> > 2010/1/20 Jaakko Heinonen :
> >> Author: jh
> >> Date: Wed Jan 20 16:56:20 2010
> >> New Revision: 202708
> >> URL: http://svn.freebsd.org/changeset/base/202708
> >
> >> Modified:
> >>  head/sys/fs/tmpfs/tmpfs_subr.c
> >>  head/sys/fs/tmpfs/tmpfs_vfsops.c
> >
> > Any chance of downgrading the "considered highly experimental" status
> > message of tmpfs to something less scary? Like "will probably not set
> > your hamster on fire"? :)
> >
> > I admit I haven't used it for any really demanding work but it looks
> > ok enough for /tmp on some busy systems.
> 
> And since this list is shrinking.
> http://www.freebsd.org/cgi/query-pr-summary.cgi?category=&severity=&priority=&class=&state=&sort=none&text=tmpfs&responsible=&multitext=&originator=&release=
> 
> Ronald.

I've been using it for all ports build since tmpfs appeared on FreeBSD.
Most of times, it is okay although I had to fix a couple of bumps.
There seems to be some corner cases as I see PRs come in.

Speaking of bugs, tmpfs may have problems if you do "mv a a" where
both source and target are the same; file may disappear due to some
bug with rename.2.  I tested with Linux and Solaris and "mv" prevented
problems with some of these archs.  But I forgot most of results and didn't
have time since then.

Hiro
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r197850 - head/sys/fs/tmpfs

2009-10-09 Thread Yoshihiro Ota
Could someone explain what was the cause and why this fixes the issue?

When I read it, it looked like that a vm object could be in 2 locations
and one of them looked the cause of the problem.
But I couldn't figure out thereafter.

Thanks,
Hiro

On Wed, 7 Oct 2009 23:17:15 + (UTC)
Xin LI  wrote:

> Author: delphij
> Date: Wed Oct  7 23:17:15 2009
> New Revision: 197850
> URL: http://svn.freebsd.org/changeset/base/197850
> 
> Log:
>   Add a special workaround to handle UIO_NOCOPY case.  This fixes data
>   corruption observed when sendfile() is being used.
>   
>   PR: kern/127213
>   Submitted by:   gk
>   MFC after:  2 weeks
> 
> Modified:
>   head/sys/fs/tmpfs/tmpfs_vnops.c
> 
> Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
> ==
> --- head/sys/fs/tmpfs/tmpfs_vnops.c   Wed Oct  7 23:01:31 2009
> (r197849)
> +++ head/sys/fs/tmpfs/tmpfs_vnops.c   Wed Oct  7 23:17:15 2009
> (r197850)
> @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -428,15 +430,72 @@ tmpfs_setattr(struct vop_setattr_args *v
>  }
>  
>  /* - */
> +static int
> +tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx,
> +vm_offset_t offset, size_t tlen, struct uio *uio)
> +{
> + vm_page_t   m;
> + int error;
> +
> + VM_OBJECT_LOCK(tobj);
> + vm_object_pip_add(tobj, 1);
> + m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED |
> + VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
> + if (m->valid != VM_PAGE_BITS_ALL) {
> + if (vm_pager_has_page(tobj, idx, NULL, NULL)) {
> + error = vm_pager_get_pages(tobj, &m, 1, 0);
> + if (error != 0) {
> + printf("tmpfs get pages from pager error 
> [read]\n");
> + goto out;
> + }
> + } else
> + vm_page_zero_invalid(m, TRUE);
> + }
> + VM_OBJECT_UNLOCK(tobj);
> + error = uiomove_fromphys(&m, offset, tlen, uio);
> + VM_OBJECT_LOCK(tobj);
> +out:
> + vm_page_lock_queues();
> + vm_page_unwire(m, TRUE);
> + vm_page_unlock_queues();
> + vm_page_wakeup(m);
> + vm_object_pip_subtract(tobj, 1);
> + VM_OBJECT_UNLOCK(tobj);
> +
> + return (error);
> +}
> +
> +static __inline int
> +tmpfs_nocacheread_buf(vm_object_t tobj, vm_pindex_t idx,
> +vm_offset_t offset, size_t tlen, void *buf)
> +{
> + struct uio uio;
> + struct iovec iov;
> +
> + uio.uio_iovcnt = 1;
> + uio.uio_iov = &iov;
> + iov.iov_base = buf;
> + iov.iov_len = tlen;
> +
> + uio.uio_offset = 0;
> + uio.uio_resid = tlen;
> + uio.uio_rw = UIO_READ;
> + uio.uio_segflg = UIO_SYSSPACE;
> + uio.uio_td = curthread;
> +
> + return (tmpfs_nocacheread(tobj, idx, offset, tlen, &uio));
> +}
>  
>  static int
>  tmpfs_mappedread(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio 
> *uio)
>  {
> + struct sf_buf   *sf;
>   vm_pindex_t idx;
>   vm_page_t   m;
>   vm_offset_t offset;
>   off_t   addr;
>   size_t  tlen;
> + char*ma;
>   int error;
>  
>   addr = uio->uio_offset;
> @@ -461,33 +520,30 @@ lookupvpg:
>   vm_page_wakeup(m);
>   VM_OBJECT_UNLOCK(vobj);
>   return  (error);
> + } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) {
> + if (vm_page_sleep_if_busy(m, FALSE, "tmfsmr"))
> + goto lookupvpg;
> + vm_page_busy(m);
> + VM_OBJECT_UNLOCK(vobj);
> + sched_pin();
> + sf = sf_buf_alloc(m, SFB_CPUPRIVATE);
> + ma = (char *)sf_buf_kva(sf);
> + error = tmpfs_nocacheread_buf(tobj, idx, offset, tlen,
> + ma + offset);
> + if (error == 0) {
> + uio->uio_offset += tlen;
> + uio->uio_resid -= tlen;
> + }
> + sf_buf_free(sf);
> + sched_unpin();
> + VM_OBJECT_LOCK(vobj);
> + vm_page_wakeup(m);
> + VM_OBJECT_UNLOCK(vobj);
> + return  (error);
>   }
>   VM_OBJECT_UNLOCK(vobj);
>  nocache:
> - VM_OBJECT_LOCK(tobj);
> - vm_object_pip_add(tobj, 1);
> - m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED |
> - VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
> - if (m->valid != VM_PAGE_BITS_ALL) {
> - if (vm_pager_has_page(tobj, idx, NULL, NULL)) {
> - error = vm_pager_get_pages(tobj, &m, 1, 0);
> - if (error != 0) {
> - printf("tmpfs get pages from pager error 
> [read]\n");
> - goto out;
> - 

Re: svn commit: r189625 - head/sys/geom/eli

2009-03-10 Thread Yoshihiro Ota
On Tue, 10 Mar 2009 19:01:57 +0100
Guido van Rooij  wrote:

> On Tue, Mar 10, 2009 at 05:19:48PM +0100, Fabian Keil wrote:
> > > Log:
> > >   When attaching a geli on boot make sure that it is detached
> > >   upon last close. (needed for a gmirror to properly shutdown
> > >   upon reboot when a geli is on top the gmirror)
> > > 
> > 
> > Detach-on-last-close is known to cause panics when
> > scrubbing at least some ZFS pools:
> > http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/117158
> > 
> > Quoting the PR:
> > |Quoting Pawel Jakub Dawidek's response to my initial report:
> > ||GELI's detach-on-last-close mechanism is a general purpose mechanism, it
> > ||may not work correctly with ZFS, because ZFS sometimes closes and reopen
> > ||providers, which will make GELI to detach. In other words you shouldn't
> > ||configure detach-on-last-close for ZFS components. 
> > 
> 
> Grr. So we should make it tuneable. How about being able to set
> this flag with the geli command, like the G_ELI_FLAG_BOOT flag.
> 
> -Guido

Can we move its implementation into the GEOM framwork such that all of
GEOM classes can have detach-on-last-close?  It will need some kind of
custom hook such that each class can do something extra, i.e. gjournal
sync.  I often need to stop providers to securely detach USB disks.

Hiro
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r187130 - head/sbin/mount

2009-01-15 Thread Yoshihiro Ota
While you are working on mount, can you take a look at this patch?
http://lists.freebsd.org/pipermail/freebsd-current/2007-February/068980.html

The problem is that all mount_XXX programs that are not in the base system
fail; i.e. everything from the ports or all mount_XXX programs anyone creates
out side of the base system.

I am not sure what is happening with nmount(2) and mount(1) programs or
if these file-system list are temporary or permanent.  It will be nice
if someone can give me a pointer or short summary on the plan for nmount().

Thanks,
Hiro

On Tue, 13 Jan 2009 06:08:37 + (UTC)
"David E. O'Brien"  wrote:

> Author: obrien
> Date: Tue Jan 13 06:08:37 2009
> New Revision: 187130
> URL: http://svn.freebsd.org/changeset/base/187130
> 
> Log:
>   r187093 failed to keep the lifetime of the pointer suitable for reentrancy.
>   Fix that.  Also move the current buffer size into the 'cpa' structure.
> 
> Modified:
>   head/sbin/mount/mount.c
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"