commit ed04cae2abc1fb11918690ef4c7fd712099ee2eb
Author: Erez_Zadok <[EMAIL PROTECTED]>
Date:   Tue Jul 31 03:33:24 2007 -0400

    Unionfs: fixes to cache-coherency checking code
    
    Under memory pressure, in_newer_lower could be called on uninitialized
    dentries or inodes.  So return 0 safely in that case (rather than oops).
    This is OK because is_newer_lower will be called again on the same object(s)
    and cache-coherency will be validated and maintained then.
    
    Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>

diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
index 11d898d..f3c1258 100644
--- a/fs/unionfs/dentry.c
+++ b/fs/unionfs/dentry.c
@@ -189,10 +189,15 @@ out:
 int is_newer_lower(const struct dentry *dentry)
 {
        int bindex;
-       struct inode *inode = dentry->d_inode;
+       struct inode *inode;
        struct inode *lower_inode;
 
-       if (!inode)
+       /* ignore if we're called on semi-initialized dentries/inodes */
+       if (!dentry || !UNIONFS_D(dentry))
+               return 0;
+       inode = dentry->d_inode;
+       if (!inode || !UNIONFS_I(inode) ||
+           ibstart(inode) < 0 || ibend(inode) < 0)
                return 0;
 
        for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to