diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index aed8fda3302497dcc1b9d6421ce6d881f58ee143..7505b4f1f5971dd37ba25c6b736be1deab22f743 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -170,11 +170,11 @@ static int __dcache_readdir(struct file *filp, spin_lock(&inode->i_lock); spin_lock(&dcache_lock); + last = dentry; + if (err < 0) goto out_unlock; - last = dentry; - p = p->prev; filp->f_pos++;