linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Cc: linux-nfs@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Fan Yong <yong.fan@whamcloud.com>,
	bfields@redhat.com, Andreas Dilger <adilger@whamcloud.com>
Subject: Re: [PATCH 5 2/4] Return 32/64-bit dir name hash according to usage type
Date: Mon, 23 Apr 2012 15:37:06 -0500	[thread overview]
Message-ID: <4F95BD72.6090200@redhat.com> (raw)
In-Reply-To: <4F93FED6.6090505@itwm.fraunhofer.de>

On 4/22/12 7:51 AM, Bernd Schubert wrote:
> On 04/20/2012 10:04 PM, Eric Sandeen wrote:
>> On 1/9/12 7:21 AM, Bernd Schubert wrote:
>>> From: Fan Yong <yong.fan@whamcloud.com>
>>>
>>> Traditionally ext2/3/4 has returned a 32-bit hash value from llseek()
>>> to appease NFSv2, which can only handle a 32-bit cookie for seekdir()
>>> and telldir().  However, this causes problems if there are 32-bit hash
>>> collisions, since the NFSv2 server can get stuck resending the same
>>> entries from the directory repeatedly.
>>>
>>> Allow ext4 to return a full 64-bit hash (both major and minor) for
>>> telldir to decrease the chance of hash collisions.  This still needs
>>> integration on the NFS side.
>>>
>>> Patch-updated-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
>>> (blame me if something is not correct)
>>
>> Bernd, I've merged this to ext3.  Bruce thought maybe you were working
>> on the same.  Should I send mine?
> 
> That is perfectly fine with me.
> 
>>
>> Also...
>>
>>> +/*
>>> + * ext4_dir_llseek() based on generic_file_llseek() to handle both
>>> + * non-htree and htree directories, where the "offset" is in terms
>>> + * of the filename hash value instead of the byte offset.
>>> + *
>>> + * NOTE: offsets obtained *before* ext4_set_inode_flag(dir, EXT4_INODE_INDEX)
>>> + *       will be invalid once the directory was converted into a dx directory
>>> + */
>>> +loff_t ext4_dir_llseek(struct file *file, loff_t offset, int origin)
>>
>> ext4_llseek() worries about max offset for direct/indirect vs. extent-mapped
>> files.  Do we need to worry about the same thing in this function?
> 
> Hrmm, I just checked it and I think either is wrong. We only have to
> care about non-dx directories, so ext4_readdir() applies, which limits
> filp->f_pos < inode->i_size.
> Going to send a patch tomorrow. Thanks for spotting this!

The other thing I'm wondering is whether, in light of

ef3d0fd27e90f67e35da516dafc1482c82939a60 vfs: do (nearly) lockless generic_file_llseek

taking the i_mutex in ext4_dir_llseek could be a perf regression vs what was there before?  Is there anything about the new function which requires stronger locking?

I may be missing something obvious about the nfs interaction, not sure.

-Eric

> Cheers,
> Bernd
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2012-04-23 20:37 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09 13:21 [PATCH 0/4] [RESEND] 32/64 bit llseek hashes (v5) Bernd Schubert
2012-01-09 13:21 ` [PATCH 5 1/4] Add new FMODE flags: FMODE_32bithash and FMODE_64bithash Bernd Schubert
2012-01-09 13:21 ` [PATCH 5 2/4] Return 32/64-bit dir name hash according to usage type Bernd Schubert
2012-03-05 15:59   ` Ted Ts'o
2012-03-06  0:40     ` Bernd Schubert
2012-03-06  2:28       ` Ted Ts'o
2012-03-06  9:59         ` Bernd Schubert
2012-03-06 15:15           ` Ted Ts'o
2012-03-07  9:01             ` Bernd Schubert
2012-04-20 20:04   ` Eric Sandeen
2012-04-22 12:51     ` Bernd Schubert
2012-04-23 20:37       ` Eric Sandeen [this message]
2012-04-23 20:52         ` Bernd Schubert
2012-04-23 21:22           ` Eric Sandeen
2012-04-23 22:23           ` Eric Sandeen
2012-04-23 22:42             ` Andreas Dilger
2012-04-24 16:10               ` Bernd Schubert
2012-01-09 13:21 ` [PATCH 5 3/4] nfsd_open(): rename 'int access' to 'int may_flags' in nfsd_open() Bernd Schubert
2012-03-06  0:08   ` Ted Ts'o
2012-03-06  2:08     ` J. Bruce Fields
2012-03-06 15:18       ` Ted Ts'o
2012-03-06 15:28         ` J. Bruce Fields
2012-03-09 20:51           ` Ted Ts'o
2012-03-12 15:09             ` Ted Ts'o
2012-03-12 15:49               ` J. Bruce Fields
2012-03-12 22:22                 ` J. Bruce Fields
2012-03-13 20:01                   ` J. Bruce Fields
2012-03-13 20:03                     ` Bernd Schubert
2012-03-13 20:34                       ` J. Bruce Fields
2012-03-13 21:09                         ` Bernd Schubert
2012-03-13 21:29                           ` J. Bruce Fields
2012-03-14 14:32                             ` Bernd Schubert
2012-03-14 16:05                               ` J. Bruce Fields
2012-03-16 21:22                                 ` Bernd Schubert
2012-03-19  2:54                                   ` Ted Ts'o
2012-03-19 20:00                                     ` J. Bruce Fields
2012-03-20  0:10                                       ` Ted Ts'o
2012-04-12 20:49                               ` J. Bruce Fields
2012-04-12 21:22                                 ` Bernd Schubert
2012-04-12 21:25                                   ` J. Bruce Fields
2012-03-13 21:10                         ` Ted Ts'o
2012-03-13 21:27                           ` J. Bruce Fields
2012-01-09 13:21 ` [PATCH 5 4/4] nfsd: vfs_llseek() with 32 or 64 bit offsets (hashes) Bernd Schubert
2012-01-10 11:27 ` [PATCH 0/4] [RESEND] 32/64 bit llseek hashes (v5) Andreas Dilger
2012-01-11 14:48   ` J. Bruce Fields
2012-01-11 15:31     ` Ted Ts'o
2012-03-05 12:23       ` Bernd Schubert

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=4F95BD72.6090200@redhat.com \
    --to=sandeen@redhat.com \
    --cc=adilger@whamcloud.com \
    --cc=bernd.schubert@itwm.fraunhofer.de \
    --cc=bfields@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=yong.fan@whamcloud.com \
    /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;
as well as URLs for NNTP newsgroup(s).