Alastair Neil
2009-Feb-23 19:51 UTC
[zfs-discuss] race condition on zfs create and mounting? with snv_107
Hi I have a script that creates accounts and zfs file systems for each account. The list of accounts is fairly large ~5200. I have in the past been able to run this script and create filesystems for all 5200 accounts. With snv_107 I get periodic failures while running the script. primarily the failure seem to revolve around actions taken after the zfs file systems are created e.g this is an excerpt from a relevant portion of the script: ${ZFS} create -o mountpoint=${Z_WEBPATH} ${W_ZFS}> RTN=$? > if [ $RTN -ne 0 ]; then > Msg="ZFS create ${Z_WEBPATH} in ${U_WEB} failed with return=$RTN > [$REC]." > $ACCTLOG $LOG_ERR "$Msg" > . /usr/local/idm/CaptureEnv > return $FAIL > fi > > $MKDIR ${Z_WEBPATH}/public_html > $MKDIR ${Z_WEBPATH}/htaccess > cp /etc/skel/* ${Z_HOMEPATH} > cp /etc/skel/.profile ${Z_HOMEPATH} > > $CHOWN -R $UNAME:$GID ${Z_HOMEPATH} > $CHOWN -R $UNAME:$GID ${Z_WEBPATH} > >an example of the errors I see: ddxxxxx,61622,500,student,David D Dxxxxx> mkdir: cannot create directory `/srv/web/u0/d/d/ddxxxxx/public_html'': No > such file or directory > mkdir: cannot create directory `/srv/web/u0/d/d/ddxxxxxhtaccess'': No such > file or directory > chown: cannot access `/srv/web/u0/d/d/ddxxxxx'': No such file or directoryand yet the filesystem exists and is mounted at some later point: $ zfs list | grep ddxxxxx> home/ddxxxxx 23.5K 3.00G 23.5K /srv/home/u0/d/d/ddxxxxx > web/ddxxxxx 18K 300M 18K /srv/web/u0/d/d/ddxxxxxI can only assume that there is some race condition, that zfs returns before it has actually mounted the filesystem. Similar errors also happen periodically on the other pool. The script runs correctly initially and then errors start appearing with increasing frequency, but not consistently. The underlying devices of the pool are iscsi volumes so they may not be the fastest pools, however, I have successfully run this script without error on previous versions of OS and Solaris 10. Any ideas? is there a known issue I should be aware of? Thanks, Alastair Neil -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090223/df6d83dc/attachment.html>