public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: linux-kernel@vger.kernel.org
Subject: the problem of dentry cache handling on vfat
Date: 16 Aug 2001 00:04:47 +0900	[thread overview]
Message-ID: <87y9oll5yo.fsf@devron.myhome.or.jp> (raw)

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>


                 reply	other threads:[~2001-08-15 15:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y9oll5yo.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox