public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* the problem of dentry cache handling on vfat
@ 2001-08-15 15:04 OGAWA Hirofumi
  0 siblings, 0 replies; only message in thread
From: OGAWA Hirofumi @ 2001-08-15 15:04 UTC (permalink / raw)
  To: linux-kernel

Hi,

I found the problem of vfat, it miss handling the dentry cache.
This problem reproduce by the following operations.

------------------------------------------------------------
    root@devron (/)[503]# mount -t vfat /dev/hda2 /mnt/
    root@devron (/)[505]# touch /mnt/File.Txt
    root@devron (/)[506]# ls /mnt/
    File.Txt
    root@devron (/)[507]# umount /mnt/
    root@devron (/)[508]# mount -t vfat /dev/hda2 /mnt/
    root@devron (/)[509]# rm -f /mnt/File.Txt 
    root@devron (/)[510]# touch /mnt/file.txt
    root@devron (/)[511]# ls /mnt/
    File.Txt
    root@devron (/)[512]# 
------------------------------------------------------------

The above created `File.Txt', although creating `file.txt'.
This problem hit the dentry cache, and vfat create the file by old
filename.

Umm, How should this problem be solved?
IMHO, the following. 

   a) delete the negative dentry cache

        static struct dentry_operations vfat_relaxed_dentry_ops = {
        	d_hash:		vfat_hashi,
        	d_compare:	vfat_cmpi,
        	d_delete:	vfat_dentry_delete,
        };
        static int vfat_dentry_delete(struct dentry *dentry)
        {
        	PRINTK1(("vfat_dentry_delete: %s, %p\n",
        		 dentry->d_name.name, dentry->d_inode));
        	if (dentry->d_inode != NULL)
        		return 0;
        
        	return 1;
        }

    b) add d_revalidate to all dentry cache

        static struct dentry_operations vfat_dentry_ops = {
        	d_revalidate:	vfat_revalidate,
        	d_hash:		vfat_hashi,
        	d_compare:	vfat_cmpi,
        };
        struct dentry *vfat_lookup(struct inode *dir,struct dentry *dentry)
        {
		inode = NULL;
		res = vfat_find(dir,&dentry->d_name,&sinfo,&bh,&de);
        	if (res < 0)
        		goto error;
        
        	...
        
        error:
        	dentry->d_op = dir->i_sb->s_root->d_op;
        	dentry->d_time = dentry->d_parent->d_inode->i_version;
        	d_add(dentry,inode);
        	return NULL;
        }

    c) other??


I don't know what is good. Please advise.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-15 15:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-15 15:04 the problem of dentry cache handling on vfat OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox