Revision: 10126
http://freenas.svn.sourceforge.net/freenas/?rev=10126&view=rev
Author: yaberauneya
Date: 2012-02-13 20:22:58 +0000 (Mon, 13 Feb 2012)
Log Message:
-----------
Make shadow copies work again by properly ordering the vfs objects modules.
In previous versions, zfsacl was less strict and the ordering appears to
have worked with zfsacl being loaded before shadow_copy2. In newer versions
of samba (3.6.1+) however, this isn't the case as it tries to look up the
ACLs and subsequently fails.
The ordering [with shadow_copy2 and zfsacl] matches what is being done on
the legacy branch.
This fixes the following tickets: 935, 1186, 1275
Modified Paths:
--------------
trunk/nanobsd/Files/etc/rc.d/ix-samba
Modified: trunk/nanobsd/Files/etc/rc.d/ix-samba
===================================================================
--- trunk/nanobsd/Files/etc/rc.d/ix-samba 2012-02-13 19:43:00 UTC (rev 10125)
+++ trunk/nanobsd/Files/etc/rc.d/ix-samba 2012-02-13 20:22:58 UTC (rev 10126)
@@ -394,6 +394,8 @@
{
local IFS="|"
+ local vfs_objects
+
${FREENAS_SQLITE_CMD} ${FREENAS_CONFIG} "
SELECT
cifs_name,
@@ -421,14 +423,11 @@
do
if [ -d "${mountpoint}" ]; then
- vfsobj_shadow=" "
+ vfs_objects=
fs=$(zfs list -H -o mountpoint,name|grep -E "${mountpoint} "|awk '{print $2}')
if [ -n "${fs}" ]; then
task_rint=`${FREENAS_SQLITE_CMD} ${FREENAS_CONFIG} "SELECT task_ret_count FROM storage_task WHERE task_filesystem='${fs}' LIMIT 1;"`
task_runit=`${FREENAS_SQLITE_CMD} ${FREENAS_CONFIG} "SELECT task_ret_unit FROM storage_task WHERE task_filesystem=\"${fs}\" LIMIT 1;" | /usr/bin/cut -c1`
- if [ -n "${task_rint}" ]; then
- vfsobj_shadow=" shadow_copy2"
- fi
fi
echo "[${name}]"
@@ -467,8 +466,8 @@
zfsacl=$(is_within_zfs "${mountpoint}")
if [ "${recyclebin}" = "1" ]; then
+ vfs_objects="$vfs_objects recycle"
cat<<-EOF
- vfs objects = ${zfsacl} recycle${vfsobj_shadow}
recycle:repository = .recycle/%U
recycle:keeptree = yes
recycle:versions = yes
@@ -476,10 +475,9 @@
recycle:directory_mode = 0777
recycle:subdir_mode = 0700
EOF
- else
- echo " vfs objects = ${zfsacl} ${vfsobj_shadow}"
fi
if [ -n "${task_rint}" ]; then
+ vfs_objects="$vfs_objects shadow_copy2"
cat <<-EOF
shadow: snapdir = .zfs/snapshot
shadow: sort = desc
@@ -487,6 +485,16 @@
shadow: format = auto-%Y%m%d.%H%M-${task_rint}${task_runit}
EOF
fi
+
+ # Order matters. shadow_copy2 must be enabled before
+ # zfsacl, otherwise zfsacl will prevent shadow_copy2
+ # from working because of permissions issues.
+ vfs_objects="$vfs_objects $zfsacl"
+
+ if [ -n "$vfs_objects" ]
+ then
+ echo " vfs objects = $vfs_objects"
+ fi
if [ "${showhiddenfiles}" = "1" ]; then
echo " hide dot files = no"
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|