search for: o_excl

Displaying 20 results from an estimated 142 matches for "o_excl".

2002 Jun 17
1
O_EXCL unreliable?
Hi all, I fear I can't rely on "open (path, O_CREAT | O_EXCL)" behaviour on samba share. The libc's doc says: If both `O_CREAT' and `O_EXCL' are set, then `open' fails if the specified file already exists. This is guaranteed to never clobber an existing file. But this isn't probably true on network filesystems. Wh...
2007 Jul 04
1
dotlock O_EXCL query
Hi there, I was wondering if someone can assist with clarifying why O_EXCL does not always work with NFS. Is it related to NFS protocol version support or export permissions mode out of the Celerra/Netapp ( e.g: mixed mode, unix file permissions ? ) Please advise. Thanks. Regards, new dovecot user.
2004 Jul 20
3
Bug? 1.0.0-test28 NFS locking problems
...at all. 1) fcntl with F_SETLKW will not work against a Solaris 2.8 server as proved with a small test program. Other forms of fcntl (ie F_SETLK) are OK. I noticed there are some code witches, but setting mbox_lock_timeout=0 only seems to knock one of the fcntl's over to F_SETLK 2) O_CREAT | O_EXCL are documented not to work over NFS properly (see man open(2) on linux). So I knocked out the O_EXCL and combined with (1) dovecot will talk over NFS to remote mbox files. THESE ARE NOT VIABLE CODE PATCHES They illustrate a problem I found - they are hackish and totally wrong. I'm not sure of...
2008 May 14
0
Using O_EXCL flag on /dev/zvol nodes
The /dev/[r]dsk nodes implement the O_EXCL flag. If a node is opened using the O_EXCL, subsequent open(2) to that node fail. But I dont think the same is true for /dev/zvol/[r]dsk nodes. Is that a bug (or maybe RFE) ? Thanks Sumit -- This messages posted from opensolaris.org
2013 Mar 21
4
[PATCH] btrfs-progs: make btrfs dev scan multi path aware
We should avoid using non multi-path (mp) path for mp disks As of now there is no good way (like api) to check that. A workaround way is to check if the O_EXCL open is unsuccessful. This is safe since otherwise the BTRFS_IOC_SCAN_DEV ioctl would fail if the disk-path can not be opened with the flag O_EXCL set. This patch also includes some (error) print format changes related to the btrfs dev scan.. Signed-off-by: Anand Jain <anand.jain@oracle.co...
2020 Jan 20
2
Stale pid file problem, and a proposed solution
Today, rsyncd manages its pid file by open()ing it with O_CREAT|O_EXCL at startup, and then unlink()ing it at shutdown. If the open() fails at startup because the file already exists, then rsyncd will assume another instance of itself is already running and not start. However, there's a problem with this approach: if rsyncd is terminated without being able to cle...
2001 Nov 13
2
direct write patch
...outputting "Error 20". Specifically, I am writing a linux root fs to a 32Meg compact flash, and libc needs to be updated, and rsync fails. This patch simply sets fnametmp to fname. Two issues with the patch, that hopefully developers can answer: - In direct-write mode, I open without O_EXCL, as the file likely does exist. Should the destination file be deleted instead? (I do not know what exactly the race condition is) - There is a section after the assignment of fnametmp, and before the open that does do_mktemp, then receive_data. What is the purpose of this part? I skip it for...
2013 Feb 12
10
[PATCH] Btrfs-progs: check out if the swap device
Currently, the following commands succeed. # cat /proc/swaps Filename Type Size Used Priority /dev/sda3 partition 8388604 0 -1 /dev/sdc8 partition 9765884 0 -2 # mkfs.btrfs /dev/sdc8 WARNING! - Btrfs v0.20-rc1-165-g82ac345 IS EXPERIMENTAL WARNING! - see
2001 Nov 29
1
cannot create .hosts.b0WX1x : File exists
...tly the same LinuX distribution, permissions and users than on the problem targethost. I have exactly the same configuration than on the other machines, except on probelm targethost I have SCSI hard disk. When i strace the rsync --deamon i get: 4697 open(".hosts.b0WX1x", O_RDWR|O_CREAT|O_EXCL|0x8000, 0600) = 4 4697 open(".hosts.b0WX1x", O_WRONLY|O_CREAT|O_EXCL|0x8000, 0600) = -1 EEXIST (File exists) It seems like it opens the file ReadWrite and then tries to open it readonly. I don't know why. It bangs then. Thanks for any hint, Rok Krulec Portoroz/Slovenia, 28.Nov...
2003 May 14
1
Bug with Large Files on AIX
...) && !defined(_AIX) { int fd = mkstemp(template); if (fd == -1) return -1; *************** *** 164,170 **** --- 164,174 ---- } #else if (!mktemp(template)) return -1; + #if defined(O_LARGEFILE) + return do_open(template, O_RDWR|O_EXCL|O_CREAT|O_LARGEFILE, perms); + #else return do_open(template, O_RDWR|O_EXCL|O_CREAT, perms); + #endif #endif } Regards, Martin Schaller
2016 Apr 26
2
poor samba performance with many smaller files
Hi, I need to to open existing readonly files. Yes you are right, not the open call takes the time, but stat() system call. I looked at aio_pthread source, the lines which needs to be removed to make it work are just the lines which tests for O_CREAT|O_EXCL? What problems can cause such solution for readonly share? On Tue, Apr 26, 2016 at 8:42 PM, Jeremy Allison <jra at samba.org> wrote: > On Tue, Apr 26, 2016 at 03:49:44PM +0200, Peter Bulin wrote: > > Hi, > > > > I have problem with my samba. I have shared folder which c...
2010 Nov 25
4
[PATCH]improve suspend_evtchn lock processing
...nt lock_suspend_event(xc_interface *xch, int domid) { int fd, rc; @@ -27,6 +59,7 @@ snprintf(suspend_file, sizeof(suspend_file), "%s_%d_lock.d", SUSPEND_LOCK_FILE, domid); + clean_obsolete_lock(domid); mask = umask(022); fd = open(suspend_file, O_CREAT | O_EXCL | O_RDWR, 0666); if (fd < 0) @@ -41,6 +74,9 @@ rc = write_exact(fd, buf, strlen(buf)); close(fd); + if(rc) + unlink(suspend_file); + return rc; } @@ -127,8 +163,7 @@ return suspend_evtchn; cleanup: - if (suspend_evtchn != -1) - xc_suspend_evtchn_r...
2009 Jun 10
1
Weird behavior in receive_data function
...o build origin files!\n"); > ch = 0; > for(l = 0; l < count; l++) > { > memset(buffer,0, 256); > sprintf(buffer,"media-test-3MB-file/origin/test/test%02d.dat",l); > printf("writting %s \n",buffer); > fd = open(buffer, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR); > for(lll = 0; lll < nSize; lll++) > { > for(mmm = 0; mmm < nAdjust; mmm++) > { > for(nnn = 0; nnn < nBlock; nnn++) > { > write_fhead_char(fd, &ch, 1); > } > ch++; > } > } > } >...
2007 Jan 05
3
1.0.rc16 released
...s with the specification" for reasoning why this is safe. This makes saving mails faster, and also makes Dovecot usable with Mac OS X's HFS+ (after you also set dotlock_use_excl=yes, see below). + Added dotlock_use_excl setting. If enabled, dotlocks are created directly using O_EXCL flag, instead of by creating a temporary file which is hardlinked. O_EXCL is faster, but may not work with NFS. + If Dovecot crashes with Linux or Solaris, it'll log a "Raw backtrace". It's worse than gdb's backtrace, but better than nothing. + Added maildir_copy_pr...
2007 Jan 05
3
1.0.rc16 released
...s with the specification" for reasoning why this is safe. This makes saving mails faster, and also makes Dovecot usable with Mac OS X's HFS+ (after you also set dotlock_use_excl=yes, see below). + Added dotlock_use_excl setting. If enabled, dotlocks are created directly using O_EXCL flag, instead of by creating a temporary file which is hardlinked. O_EXCL is faster, but may not work with NFS. + If Dovecot crashes with Linux or Solaris, it'll log a "Raw backtrace". It's worse than gdb's backtrace, but better than nothing. + Added maildir_copy_pr...
2013 Mar 09
4
[PATCH] use rcu_barrier() to wait for bdev puts at unmount
Doing this would reliably fail with -EBUSY for me: # mount /dev/sdb2 /mnt/scratch; umount /mnt/scratch; mkfs.btrfs -f /dev/sdb2 ... unable to open /dev/sdb2: Device or resource busy because mkfs.btrfs tries to open the device O_EXCL, and somebody still has it. Using systemtap to track bdev gets & puts shows a kworker thread doing a blkdev put after mkfs attempts a get; this is left over from the unmount. Adding an rcu_barrier() to btrfs_close_devices() causes unmount to wait until all blkdev_put()s are done, and the devi...
2016 Apr 28
1
poor samba performance with many smaller files
I removed the O_CREAT|O_EXCL checks and added check to exclude O_DIRECTORY, but it is not working, opening of files fails and I don't know why. I can see in strace logs that openat syscall in vfs_aio_pthread was successful, but it still fails and this messages are logged: [2016/04/28 13:28:59.691782, 5, pid=5623, effecti...
1999 Feb 10
1
When a shell says no (clobber) it means maybe.
...p/predicted echo "hoping stat() happens now: returns 0 and non S_ISREG" mv /tmp/predicted /tmp/other ln -s /some/old/target /tmp/predicted Is there some reason (such as standards or a situation I've overlooked) why they should do this and not say noclobber => O_EXCL, end of story ? exec.c from pdksh-5.2.12 1293 case IOWRITE: 1294 flags = O_WRONLY | O_CREAT | O_TRUNC; 1295 if (Flag(FNOCLOBBER) && !(iop->flag & IOCLOB) 1296 && (stat(cp, &statb) < 0 || S_ISREG(statb.st_mode))) 1297 flags |= O_EXCL; 1298 bre...
2013 Jun 05
2
dovecot and time
...96 read(0, "edu.\n\nDr. Johannes Ullrich is Ch"..., 4096) = 3164 read(0, "", 932) = 0 umask(0177) = 077 open("/usr/home/vpopmail/domains/havokmon.com/rick/Maildir/tmp/1370448645.M589211P14191.smtp101", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_LARGEFILE, 0777) = 11 umask(077) = 0177 open("/usr/home/vpopmail/domains/havokmon.com/rick/Maildir/dovecot.index.cache", O_RDWR|O_LARGEFILE) = 12 fstat64(12, {st_mode=S_IFREG|0600, st_size=1568768, ...}) = 0 mmap2(NULL, 1568768, PROT_READ, MAP_SH...
2007 Jan 03
3
pre-1.0.rc6 / index file problems? try this
...s with the specification" for reasoning why this is safe. This makes saving mails faster, and also makes Dovecot usable with Mac OS X's HFS+ (after you also set dotlock_use_excl=yes, see below). + Added dotlock_use_excl setting. If enabled, dotlocks are created directly using O_EXCL flag, instead of by creating a temporary file which is hardlinked. O_EXCL is faster, but may not work with NFS. + If Dovecot crashes with Linux or Solaris, it'll log a "Raw backtrace". It's worse than gdb's backtrace, but better than nothing. + Added maildir_copy_pr...