Unfortunately the bug is still observed - i did some additional triaging.
* The bug is seen only when the samba share exported is on a vfat file system
- for ext2 and ext3 the large sized copy succeeds without fail.
* I also tried using the samba package from debian-arm repositories(lenny-stable)
- but there also the problem is seen.
* Even if the error is thrown up - the file is still being copied in the background - or ftruncate'ing in the background (I suspect it is only ftruncating and filling the space with zeroes because of two reasons - one the md5sums do not match afterwards and two the code seems to be doing the same thing) - but as previously stated adding a patch to always call ftruncate64() in sys_ftruncate() does not fix the problem.
# cat log.smbd
[2009/08/15 00:00:07, 0] lib/pidfile.c:121(pidfile_create)
ERROR: smbd is already running. File /usr/local/samba/var/locks/smbd.pid exists and process id 687 is running.
삼바가 구동중에 제대로 종료되지 않고 재가동 될경우
$PIDDIR/smbd.pid
$PIDDIR/nmbd.pid
파일이 남아 있다 보면, 위와 같이 이미 구동중으로 착각을 하고
smbd나 nmbd를 구동하는데 실패를 한다.
fork() / execl() 로 구동시에는
waitpid() 에서 벗어 나지 못하고 멈추는 현상이 발생했다.
결론 : 혹시 모르니 종료가 불확실한 시스템(임베디드?)에서는 삼바 구동 이전에 pid 파일을 지워주도록 하는게 좋을듯 하다.
[ 390.900022] usb 1-2: new high speed USB device using ehci_hcd and address 3
[ 391.034412] usb 1-2: configuration #1 chosen from 1 choice
[ 391.036408] uvcvideo: Found UVC 1.00 device USB2.0 PC CAMERA (18ec:3299)
[ 391.038963] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
[ 391.049412] input: USB2.0 PC CAMERA as /devices/pci0000:00/0000:00:10.4/usb1/1-2/1-2:1.0/input/input5
이녀석은.. UVC로 인식은 하는데 제대로 쓰지는 못한다.
물론 /dev/video0 로 생성은 된다. (내가 쓸줄 몰라서 그런걸지도 ㄱ-)
(윈도우에서는 드라이버 설치 없이 되지만, Ubuntu 9.10에서는 UVC로 인식하려다 실패한다.)
#include <sys/ioctl.h>
int ioctl(int d, int request, ...);
이런 모양인데, int d는 descriptor로 socket을 통해 받아와야 한다.
그리고 request는 /usr/include/bits/ioctls.h 파일에 정의된 내용을 사용하면 된다.
/* Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _SYS_IOCTL_H
# error "Never use directly; include instead."
#endif
/* Use the definitions from the kernel header files. */
#include "asm/ioctls.h"
/* Routing table calls. */
#define SIOCADDRT 0x890B /* add routing table entry */
#define SIOCDELRT 0x890C /* delete routing table entry */
#define SIOCRTMSG 0x890D /* call to routing system */
/* Socket configuration controls. */
#define SIOCGIFNAME 0x8910 /* get iface name */
#define SIOCSIFLINK 0x8911 /* set iface channel */
#define SIOCGIFCONF 0x8912 /* get iface list */
#define SIOCGIFFLAGS 0x8913 /* get flags */
#define SIOCSIFFLAGS 0x8914 /* set flags */
#define SIOCGIFADDR 0x8915 /* get PA address */
#define SIOCSIFADDR 0x8916 /* set PA address */
#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
#define SIOCGIFNETMASK 0x891b /* get network PA mask */
#define SIOCSIFNETMASK 0x891c /* set network PA mask */
#define SIOCGIFMETRIC 0x891d /* get metric */
#define SIOCSIFMETRIC 0x891e /* set metric */
#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
#define SIOCGIFMTU 0x8921 /* get MTU size */
#define SIOCSIFMTU 0x8922 /* set MTU size */
#define SIOCSIFNAME 0x8923 /* set interface name */
#define SIOCSIFHWADDR 0x8924 /* set hardware address */
#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
#define SIOCSIFENCAP 0x8926
#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
#define SIOCSIFSLAVE 0x8930
#define SIOCADDMULTI 0x8931 /* Multicast address lists */
#define SIOCDELMULTI 0x8932
#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
#define SIOCGIFPFLAGS 0x8935
#define SIOCDIFADDR 0x8936 /* delete PA address */
#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
#define SIOCGIFCOUNT 0x8938 /* get number of devices */
#define SIOCGIFBR 0x8940 /* Bridging support */
#define SIOCSIFBR 0x8941 /* Set bridging options */
#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
/* ARP cache control calls. */
/* 0x8950 - 0x8952 * obsolete calls, don't re-use */
#define SIOCDARP 0x8953 /* delete ARP table entry */
#define SIOCGARP 0x8954 /* get ARP table entry */
#define SIOCSARP 0x8955 /* set ARP table entry */
/* RARP cache control calls. */
#define SIOCDRARP 0x8960 /* delete RARP table entry */
#define SIOCGRARP 0x8961 /* get RARP table entry */
#define SIOCSRARP 0x8962 /* set RARP table entry */
/* Driver configuration calls */
#define SIOCGIFMAP 0x8970 /* Get device parameters */
#define SIOCSIFMAP 0x8971 /* Set device parameters */
/* DLCI configuration calls */
#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
/* Device private ioctl calls. */
/* These 16 ioctls are available to devices via the do_ioctl() device
vector. Each device should include this file and redefine these
names as their own. Because these are device dependent it is a good
idea _NOT_ to issue them to random objects and hope. */
#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
/*
* These 16 ioctl calls are protocol private
*/
#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
잠시 socket을 소개하자면
#include <sys/socket.h>
int socket(int domain, int type, int protocol);
domain
Name Purpose Man page
PF_UNIX, PF_LOCAL Local communication unix(7)
PF_INET IPv4 Internet protocols ip(7)
PF_INET6 IPv6 Internet protocols
PF_IPX IPX - Novell protocols
PF_NETLINK Kernel user interface device netlink(7)
PF_X25 ITU-T X.25 / ISO-8208 protocol x25(7)
PF_AX25 Amateur radio AX.25 protocol
PF_ATMPVC Access to raw ATM PVCs
PF_APPLETALK Appletalk ddp(7)
PF_PACKET Low level packet interface packet(7)
type
SOCK_STREAM
Provides sequenced, reliable, two-way, connection-based byte streams. An out-of-band data transmission
mechanism may be supported.
SOCK_DGRAM
Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
SOCK_SEQPACKET(is not implemented for AF_INET)
Provides a sequenced, reliable, two-way connection-based data transmission path for datagrams of fixed
maximum length; a consumer is required to read an entire packet with each read system call.
SOCK_RAW
Provides raw network protocol access.
SOCK_RDM
Provides a reliable datagram layer that does not guarantee ordering.
SOCK_PACKET
Obsolete and should not be used in new programs; see packet(7).
protocol
Normally only a single protocol exists to support a particular socket type within a given protocol family, in which case protocol can be specified as 0.