From: Bernd Schubert Subject: Re: [PATCH 5 2/4] Return 32/64-bit dir name hash according to usage type Date: Sun, 22 Apr 2012 14:51:34 +0200 Message-ID: <4F93FED6.6090505@itwm.fraunhofer.de> References: <20120109132137.2616029.76288.stgit@localhost.localdomain> <20120109132148.2616029.68798.stgit@localhost.localdomain> <4F91C15B.6070200@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Fan Yong , bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Andreas Dilger To: Eric Sandeen Return-path: In-Reply-To: <4F91C15B.6070200-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-ext4.vger.kernel.org On 04/20/2012 10:04 PM, Eric Sandeen wrote: > On 1/9/12 7:21 AM, Bernd Schubert wrote: >> From: Fan Yong >> >> 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 >> (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! Cheers, Bernd -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html