]> arthur.barton.de Git - netatalk.git/commitdiff
Fix
authorFrank Lahm <franklahm@googlemail.com>
Sun, 22 Jan 2012 14:47:22 +0000 (15:47 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Sun, 22 Jan 2012 14:47:22 +0000 (15:47 +0100)
libatalk/adouble/ad_flush.c
libatalk/adouble/ad_lock.c

index 397e8167ea2a5fc2eb10ec09a9b7a48a6fee9e05..87b8158688817bed09c9141d2df5e06b449711df 100644 (file)
@@ -351,7 +351,12 @@ int ad_close(struct adouble *ad, int adflags)
     if (ad == NULL)
         return err;
 
-    LOG(log_debug, logtype_default, "ad_close(%s)", adflags2logstr(adflags));
+    LOG(log_debug, logtype_default,
+        "ad_close(%s): BEGIN [dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
+        adflags2logstr(adflags),
+        ad_data_fileno(ad), ad->ad_data_fork.adf_refcount,
+        ad_meta_fileno(ad), ad->ad_mdp->adf_refcount,
+        ad_reso_fileno(ad), ad->ad_rfp->adf_refcount);
 
     /* cf ad_open(): we opened the datafork too for sharemode locks */
     if ((ad->ad_vers == AD_VERSION_EA) && (ad->ad_adflags & ADFLAGS_SETSHRMD))
@@ -384,5 +389,12 @@ int ad_close(struct adouble *ad, int adflags)
         }
     }
 
+    LOG(log_debug, logtype_default,
+        "ad_close(%s): END: %d [dfd: %d (ref: %d), mfd: %d (ref: %d), rfd: %d (ref: %d)]",
+        err, adflags2logstr(adflags),
+        ad_data_fileno(ad), ad->ad_data_fork.adf_refcount,
+        ad_meta_fileno(ad), ad->ad_mdp->adf_refcount,
+        ad_reso_fileno(ad), ad->ad_rfp->adf_refcount);
+
     return err;
 }
index 6961930d4e3925babc3d8e4c26e0d78dd8506e9b..ecfc62bd555a17605e1c2ed853a7699f618367e4 100644 (file)
@@ -455,7 +455,7 @@ int ad_lock(struct adouble *ad, uint32_t eid, int locktype, off_t off, off_t len
     type = locktype;
     if (eid == ADEID_DFORK) {
         adf = &ad->ad_data_fork;
-        if ((type & ADLOCK_FILELOCK)) {
+        if ((ad->ad_vers == AD_VERSION2) && (type & ADLOCK_FILELOCK)) {
             if (ad_meta_fileno(ad) != -1) { /* META */
                 adf = ad->ad_mdp;
                 lock.l_start = df2off(off);