On Thu, May 14, 2009 at 01:54:42PM +0200, Lukas Hejtmanek 
([email protected]) wrote:
> > Does sync on client make them look normal?
> 
> another observation, if I untar the kernel sources and enter into that
> directory, ls shows nothing, i.e., the directory is empty. Another ls shows
> the directory content correctly. 
> 
> unfortunately, I'm unable to reproduce the empty files.

This is a known problem for the directories, attached patch should fix
it. I did not push it into kernel yet though, POHMELFS expects serious
changes soon, when it will be ported to elliptics network storage.

commit 19a814ee49888ac149a492ce9700474713b13a9d
Author: Evgeniy Polyakov <[email protected]>
Date:   Mon Apr 27 21:48:47 2009 +0400

    POHMELFS lookup has to dig into the server when its parent dir does was not 
read from the server.

diff --git a/drivers/staging/pohmelfs/dir.c b/drivers/staging/pohmelfs/dir.c
index 50962a5..c5f3eaa 100644
--- a/drivers/staging/pohmelfs/dir.c
+++ b/drivers/staging/pohmelfs/dir.c
@@ -508,13 +508,21 @@ struct dentry *pohmelfs_lookup(struct inode *dir, struct 
dentry *dentry, struct
        struct pohmelfs_name *n;
        struct inode *inode = NULL;
        unsigned long ino = 0;
-       int err, lock_type = POHMELFS_READ_LOCK, need_lock;
+       int err, lock_type = POHMELFS_READ_LOCK, need_lock = 1;
        struct qstr str = dentry->d_name;
 
        if ((nd->intent.open.flags & O_ACCMODE) > 1)
                lock_type = POHMELFS_WRITE_LOCK;
 
-       need_lock = pohmelfs_need_lock(parent, lock_type);
+       if (test_bit(NETFS_INODE_OWNED, &parent->state)) {
+               if (lock_type == parent->lock_type)
+                       need_lock = 0;
+               if ((lock_type == POHMELFS_READ_LOCK) && (parent->lock_type == 
POHMELFS_WRITE_LOCK))
+                       need_lock = 0;
+       }
+
+       if ((lock_type == POHMELFS_READ_LOCK) && 
!test_bit(NETFS_INODE_REMOTE_DIR_SYNCED, &parent->state))
+               need_lock = 1;
 
        str.hash = jhash(dentry->d_name.name, dentry->d_name.len, 0);
 

-- 
        Evgeniy Polyakov
_______________________________________________
Pohmelfs mailing list
[email protected]
http://www.ioremap.net/cgi-bin/mailman/listinfo/pohmelfs

Reply via email to