svn commit: r249482 - in projects/camlock: . contrib/openpam/lib crypto/openssh lib/libc/nls lib/libpam sbin/geom/class/nop sys/cam sys/dev/ata sys/dev/pci sys/kern sys/sys
Alexander Motin
mav at FreeBSD.org
Sun Apr 14 18:12:43 UTC 2013
Author: mav
Date: Sun Apr 14 18:12:40 2013
New Revision: 249482
URL: http://svnweb.freebsd.org/changeset/base/249482
Log:
MFC @ 249481
Modified:
projects/camlock/ObsoleteFiles.inc
projects/camlock/contrib/openpam/lib/openpam_log.c
projects/camlock/crypto/openssh/packet.c
projects/camlock/lib/libc/nls/fr_FR.ISO8859-1.msg
projects/camlock/lib/libpam/Makefile.inc
projects/camlock/sbin/geom/class/nop/gnop.8
projects/camlock/sys/cam/cam_queue.h
projects/camlock/sys/cam/cam_xpt.c
projects/camlock/sys/dev/ata/ata-pci.c
projects/camlock/sys/dev/pci/vga_pci.c
projects/camlock/sys/kern/kern_descrip.c
projects/camlock/sys/kern/uipc_usrreq.c
projects/camlock/sys/sys/filedesc.h
Directory Properties:
projects/camlock/ (props changed)
projects/camlock/contrib/openpam/ (props changed)
projects/camlock/crypto/openssh/ (props changed)
projects/camlock/lib/libc/ (props changed)
projects/camlock/sbin/ (props changed)
projects/camlock/sys/ (props changed)
Modified: projects/camlock/ObsoleteFiles.inc
==============================================================================
--- projects/camlock/ObsoleteFiles.inc Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/ObsoleteFiles.inc Sun Apr 14 18:12:40 2013 (r249482)
@@ -70,6 +70,7 @@ OLD_FILES+=usr/include/clang/3.2/xmmintr
OLD_FILES+=usr/include/clang/3.2/xopintrin.h
OLD_DIRS+=usr/include/clang/3.2
# 20130404: legacy ATA stack removed
+OLD_FILES+=rescue/atacontrol
OLD_FILES+=sbin/atacontrol
OLD_FILES+=usr/share/man/man8/atacontrol.8.gz
OLD_FILES+=usr/share/man/man4/atapicam.4.gz
Modified: projects/camlock/contrib/openpam/lib/openpam_log.c
==============================================================================
--- projects/camlock/contrib/openpam/lib/openpam_log.c Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/contrib/openpam/lib/openpam_log.c Sun Apr 14 18:12:40 2013 (r249482)
@@ -49,11 +49,7 @@
#include "openpam_impl.h"
-#ifdef OPENPAM_DEBUG
-int openpam_debug = 1;
-#else
int openpam_debug = 0;
-#endif
#if !defined(openpam_log)
Modified: projects/camlock/crypto/openssh/packet.c
==============================================================================
--- projects/camlock/crypto/openssh/packet.c Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/crypto/openssh/packet.c Sun Apr 14 18:12:40 2013 (r249482)
@@ -1465,7 +1465,11 @@ packet_read_poll_seqnr(u_int32_t *seqnr_
case SSH2_MSG_DISCONNECT:
reason = packet_get_int();
msg = packet_get_string(NULL);
- error("Received disconnect from %s: %u: %.400s",
+ /* Ignore normal client exit notifications */
+ do_log2(active_state->server_side &&
+ reason == SSH2_DISCONNECT_BY_APPLICATION ?
+ SYSLOG_LEVEL_DEBUG1 : SYSLOG_LEVEL_ERROR,
+ "Received disconnect from %s: %u: %.400s",
get_remote_ipaddr(), reason, msg);
xfree(msg);
cleanup_exit(255);
@@ -1490,7 +1494,7 @@ packet_read_poll_seqnr(u_int32_t *seqnr_
break;
case SSH_MSG_DISCONNECT:
msg = packet_get_string(NULL);
- error("Received disconnect from %s: %.400s",
+ logit("Received disconnect from %s: %.400s",
get_remote_ipaddr(), msg);
cleanup_exit(255);
break;
Modified: projects/camlock/lib/libc/nls/fr_FR.ISO8859-1.msg
==============================================================================
--- projects/camlock/lib/libc/nls/fr_FR.ISO8859-1.msg Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/lib/libc/nls/fr_FR.ISO8859-1.msg Sun Apr 14 18:12:40 2013 (r249482)
@@ -94,7 +94,7 @@ $ EPROTONOSUPPORT
$ ESOCKTNOSUPPORT
44 Type de socket non supporté
$ EOPNOTSUPP
-45 Opération non supporté
+45 Opération non supportée
$ EPFNOSUPPORT
46 Famille de protocole non supportée
$ EAFNOSUPPORT
Modified: projects/camlock/lib/libpam/Makefile.inc
==============================================================================
--- projects/camlock/lib/libpam/Makefile.inc Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/lib/libpam/Makefile.inc Sun Apr 14 18:12:40 2013 (r249482)
@@ -24,9 +24,7 @@
#
# $FreeBSD$
-.ifdef PAM_DEBUG
-DEBUG_FLAGS+= -DDEBUG
-.endif
+CFLAGS+= -DOPENPAM_DEBUG
SHLIB_MAJOR= 5
PAM_MOD_DIR= ${LIBDIR}
Modified: projects/camlock/sbin/geom/class/nop/gnop.8
==============================================================================
--- projects/camlock/sbin/geom/class/nop/gnop.8 Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/sbin/geom/class/nop/gnop.8 Sun Apr 14 18:12:40 2013 (r249482)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 17, 2009
+.Dd April 14, 2013
.Dt GNOP 8
.Os
.Sh NAME
@@ -139,8 +139,11 @@ Debug level of the
.Nm NOP
GEOM class.
This can be set to a number between 0 and 2 inclusive.
-If set to 0 minimal debug information is printed, and if set to 2 the
-maximum amount of debug information is printed.
+If set to 0, minimal debug information is printed.
+If set to 1, basic debug information is logged along with the I/O requests
+that were returned as errors.
+If set to 2, the maximum amount of debug information is printed including
+all I/O requests.
.El
.Sh EXIT STATUS
Exit status is 0 on success, and 1 if the command fails.
Modified: projects/camlock/sys/cam/cam_queue.h
==============================================================================
--- projects/camlock/sys/cam/cam_queue.h Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/sys/cam/cam_queue.h Sun Apr 14 18:12:40 2013 (r249482)
@@ -158,10 +158,10 @@ cam_ccbq_pending_ccb_count(struct cam_cc
static __inline void
cam_ccbq_take_opening(struct cam_ccbq *ccbq);
-static __inline int
+static __inline void
cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb);
-static __inline int
+static __inline void
cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb);
static __inline union ccb *
@@ -190,29 +190,17 @@ cam_ccbq_take_opening(struct cam_ccbq *c
ccbq->held++;
}
-static __inline int
+static __inline void
cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb)
{
ccbq->held--;
camq_insert(&ccbq->queue, &new_ccb->ccb_h.pinfo);
- if (ccbq->queue.qfrozen_cnt > 0) {
- ccbq->devq_openings++;
- ccbq->held++;
- return (1);
- } else
- return (0);
}
-static __inline int
+static __inline void
cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb)
{
camq_remove(&ccbq->queue, ccb->ccb_h.pinfo.index);
- if (ccbq->queue.qfrozen_cnt > 0) {
- ccbq->devq_openings--;
- ccbq->held--;
- return (1);
- } else
- return (0);
}
static __inline union ccb *
Modified: projects/camlock/sys/cam/cam_xpt.c
==============================================================================
--- projects/camlock/sys/cam/cam_xpt.c Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/sys/cam/cam_xpt.c Sun Apr 14 18:12:40 2013 (r249482)
@@ -2464,8 +2464,8 @@ xpt_action_default(union ccb *start_ccb)
devq = path->bus->sim->devq;
mtx_lock(&devq->send_mtx);
- if (cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb) == 0 &&
- xpt_schedule_devq(devq, path->device) != 0)
+ cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb);
+ if (xpt_schedule_devq(devq, path->device) != 0)
xpt_run_devq(devq);
mtx_unlock(&devq->send_mtx);
break;
Modified: projects/camlock/sys/dev/ata/ata-pci.c
==============================================================================
--- projects/camlock/sys/dev/ata/ata-pci.c Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/sys/dev/ata/ata-pci.c Sun Apr 14 18:12:40 2013 (r249482)
@@ -571,6 +571,13 @@ ata_pci_child_location_str(device_t dev,
return (0);
}
+static bus_dma_tag_t
+ata_pci_get_dma_tag(device_t bus, device_t child)
+{
+
+ return (bus_get_dma_tag(bus));
+}
+
static device_method_t ata_pci_methods[] = {
/* device interface */
DEVMETHOD(device_probe, ata_pci_probe),
@@ -593,6 +600,7 @@ static device_method_t ata_pci_methods[]
DEVMETHOD(pci_write_config, ata_pci_write_config),
DEVMETHOD(bus_print_child, ata_pci_print_child),
DEVMETHOD(bus_child_location_str, ata_pci_child_location_str),
+ DEVMETHOD(bus_get_dma_tag, ata_pci_get_dma_tag),
DEVMETHOD_END
};
Modified: projects/camlock/sys/dev/pci/vga_pci.c
==============================================================================
--- projects/camlock/sys/dev/pci/vga_pci.c Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/sys/dev/pci/vga_pci.c Sun Apr 14 18:12:40 2013 (r249482)
@@ -419,6 +419,13 @@ vga_pci_msix_count(device_t dev, device_
return (pci_msix_count(dev));
}
+static bus_dma_tag_t
+vga_pci_get_dma_tag(device_t bus, device_t child)
+{
+
+ return (bus_get_dma_tag(bus));
+}
+
static device_method_t vga_pci_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, vga_pci_probe),
@@ -436,6 +443,7 @@ static device_method_t vga_pci_methods[]
DEVMETHOD(bus_release_resource, vga_pci_release_resource),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_get_dma_tag, vga_pci_get_dma_tag),
/* PCI interface */
DEVMETHOD(pci_read_config, vga_pci_read_config),
Modified: projects/camlock/sys/kern/kern_descrip.c
==============================================================================
--- projects/camlock/sys/kern/kern_descrip.c Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/sys/kern/kern_descrip.c Sun Apr 14 18:12:40 2013 (r249482)
@@ -1582,6 +1582,34 @@ fdalloc(struct thread *td, int minfd, in
}
/*
+ * Allocate n file descriptors for the process.
+ */
+int
+fdallocn(struct thread *td, int minfd, int *fds, int n)
+{
+ struct proc *p = td->td_proc;
+ struct filedesc *fdp = p->p_fd;
+ int i;
+
+ FILEDESC_XLOCK_ASSERT(fdp);
+
+ if (!fdavail(td, n))
+ return (EMFILE);
+
+ for (i = 0; i < n; i++)
+ if (fdalloc(td, 0, &fds[i]) != 0)
+ break;
+
+ if (i < n) {
+ for (i--; i >= 0; i--)
+ fdunused(fdp, fds[i]);
+ return (EMFILE);
+ }
+
+ return (0);
+}
+
+/*
* Check to see whether n user file descriptors are available to the process
* p.
*/
Modified: projects/camlock/sys/kern/uipc_usrreq.c
==============================================================================
--- projects/camlock/sys/kern/uipc_usrreq.c Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/sys/kern/uipc_usrreq.c Sun Apr 14 18:12:40 2013 (r249482)
@@ -1706,7 +1706,6 @@ unp_externalize(struct mbuf *control, st
void *data;
socklen_t clen = control->m_len, datalen;
int error, newfds;
- int f;
u_int newlen;
UNP_LINK_UNLOCK_ASSERT();
@@ -1732,13 +1731,6 @@ unp_externalize(struct mbuf *control, st
goto next;
}
FILEDESC_XLOCK(fdesc);
- /* if the new FD's will not fit free them. */
- if (!fdavail(td, newfds)) {
- FILEDESC_XUNLOCK(fdesc);
- error = EMSGSIZE;
- unp_freerights(fdep, newfds);
- goto next;
- }
/*
* Now change each pointer to an fd in the global
@@ -1758,17 +1750,22 @@ unp_externalize(struct mbuf *control, st
fdp = (int *)
CMSG_DATA(mtod(*controlp, struct cmsghdr *));
+ if (fdallocn(td, 0, fdp, newfds) != 0) {
+ FILEDESC_XUNLOCK(td->td_proc->p_fd);
+ error = EMSGSIZE;
+ unp_freerights(fdep, newfds);
+ m_freem(*controlp);
+ *controlp = NULL;
+ goto next;
+ }
for (i = 0; i < newfds; i++, fdp++) {
- if (fdalloc(td, 0, &f))
- panic("unp_externalize fdalloc failed");
- fde = &fdesc->fd_ofiles[f];
+ fde = &fdesc->fd_ofiles[*fdp];
fde->fde_file = fdep[0]->fde_file;
filecaps_move(&fdep[0]->fde_caps,
&fde->fde_caps);
if ((flags & MSG_CMSG_CLOEXEC) != 0)
fde->fde_flags |= UF_EXCLOSE;
unp_externalize_fp(fde->fde_file);
- *fdp = f;
}
FILEDESC_XUNLOCK(fdesc);
free(fdep[0], M_FILECAPS);
Modified: projects/camlock/sys/sys/filedesc.h
==============================================================================
--- projects/camlock/sys/sys/filedesc.h Sun Apr 14 18:09:08 2013 (r249481)
+++ projects/camlock/sys/sys/filedesc.h Sun Apr 14 18:12:40 2013 (r249482)
@@ -150,6 +150,7 @@ int falloc_noinstall(struct thread *td,
int finstall(struct thread *td, struct file *fp, int *resultfp, int flags,
struct filecaps *fcaps);
int fdalloc(struct thread *td, int minfd, int *result);
+int fdallocn(struct thread *td, int minfd, int *fds, int n);
int fdavail(struct thread *td, int n);
int fdcheckstd(struct thread *td);
void fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td);
More information about the svn-src-projects
mailing list