commit b0f3bc160be8f412ff7616d581dd6052b31a661d
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Mon Mar 19 17:20:35 2007 -0400

    cleanup thread bugs

diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
index 024f272..327c8f7 100644
--- a/fs/unionfs/dirhelper.c
+++ b/fs/unionfs/dirhelper.c
@@ -720,7 +720,6 @@ int odf_cache_dir(struct dentry *d_upper, struct dentry 
*d_odf, struct timespec
 retry: 
        unionfs_read_lock(sb);
        odf_lock(UNIONFS_SB(sb)->odf->odi_ic);
-
        BUG_ON(!S_ISDIR(d_upper->d_inode->i_mode));
 
        if ((err = unionfs_partial_lookup(d_upper)))
@@ -731,8 +730,7 @@ retry:
        /* compare mtimes, do not proceed if equal */
        if (i_odf && i_odf->i_size) { 
                if(timespec_compare(&i_odf->i_mtime,mtime) >= 0)
-               goto out;
-               
+                       goto out;       
        }
        dget(d_odf);
        mntget(UNIONFS_SB(sb)->odf->mnt);
@@ -830,6 +828,7 @@ out:
        if (buf && buf->rdstate)
                free_rdstate(buf->rdstate);
        kfree(buf);
+       buf = NULL;
 
        if (odf_file)
                filp_close(odf_file, NULL);
@@ -839,8 +838,7 @@ out:
 
        if (err == -ENOSPC && !cleaned) {
                cleaned = 1;
-               wake_up_sioa(UNIONFS_SB(sb)->odf->cleanup);
-               schedule();
+               wake_up_and_wait_sioa(UNIONFS_SB(sb)->odf->cleanup);
                goto retry;
        }
        return err;
diff --git a/fs/unionfs/sioq.c b/fs/unionfs/sioq.c
index fc87dc2..a2cc293 100644
--- a/fs/unionfs/sioq.c
+++ b/fs/unionfs/sioq.c
@@ -70,7 +70,6 @@ int __run_sioa(void *args)
                        schedule();
                }
                current->state = TASK_INTERRUPTIBLE;
-               mutex_lock(&sioa_args->sleep_lock);
                schedule_timeout(sioa_args->timeout);
        }
 
diff --git a/fs/unionfs/sioq.h b/fs/unionfs/sioq.h
index 0cda1be..2d4fd4e 100644
--- a/fs/unionfs/sioq.h
+++ b/fs/unionfs/sioq.h
@@ -56,12 +56,14 @@ struct sioq_args {
 };
 
 struct sioa_args {
-       struct completion comp;
+       struct completion comp_thread;
+       struct completion comp_work;
        struct task_struct *process;
        signed long timeout;
        void (*work) (void*);
        int (*done) (void*);
-       struct mutex sleep_lock;
+       struct mutex lock;
+       int waiting;
 
        union {
                struct cleanup_args cleanup;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to