[Gluster-users] Troubles with syscall 'lstat'

Franco Broi franco.broi at iongeo.com
Wed May 21 00:12:09 UTC 2014


If you are trying to use lstat+mkdir as a locking mechanism so that you
can run multiple instances of the same program, it will probably fail
more often on a Fuse filesystem than a local one. It should probably be
using FLOCK or open a file with O_CREAT|O_EXCL.


On Tue, 2014-05-20 at 11:58 +0200, Nicolas Greneche wrote: 
> Hello,
> 
> I run a glusterfs architecture in 3.3.1 version :
> 
> 
> # glusterd -V
> glusterfs 3.3.1 built on Apr 29 2013 15:17:28
> Repository revision: git://git.gluster.com/glusterfs.git
> Copyright (c) 2006-2011 Gluster Inc. <http://www.gluster.com>
> GlusterFS comes with ABSOLUTELY NO WARRANTY.
> You may redistribute copies of GlusterFS under the terms of the GNU 
> General Public License.
> 
> I have an odd problem when I run a software. When I run it from the 
> local filesystem it works and when I copy it to a glusterfs share it 
> produce errors.
> 
> Both instance of the program shares the same environement (the run on te 
> same instance of operating system with the same user).
> 
> The only difference I noticed is with the syscall sequence. When It 
> works I have this sequence :
> 
> write(1, "HRType:  esh_gain \n", 19)    = 19
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> write(1, "TILDE\n", 6)                  = 6
> stat64("/home/ngreneche/ubuntu1204/usr/local/ACE-ilProlog-1.2.20/linux/bin/tilde", 
> {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> write(1, "Discretization busy...\n", 23) = 23
> 
> And when it doesn't work (running from a glusterfs share), I have this 
> sequence :
> 
> write(1, "HRType:  esh_gain \n", 19)    = 19
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> write(1, "TILDE\n", 6)                  = 6
> stat64("/home/dist/db/ubuntu1204/usr/local/ACE-ilProlog-1.2.20/linux/bin/tilde", 
> {st_mode=S_IFDIR|0750, st_size=16384, ...}) = 0
> mkdir("/home/dist/db/ubuntu1204/usr/local/ACE-ilProlog-1.2.20/linux/bin/tilde", 
> 0755) = -1 EEXIST (File exists)
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
> ...}) = 0
> write(1, "An error occurred during the exe"..., 49) = 49
> 
> The only difference is that a mkdir is performed just after the stat. 
> Whereas the stat check if the directory exists to trigger or not a mkdir.
> 
> My underlying filesystem on the brick is ext4.
> 
> Do you know if there are some issues with stat in the version of glusterfs ?
> 
> Regards,
> 





More information about the Gluster-users mailing list