From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754912Ab2IXMcG (ORCPT ); Mon, 24 Sep 2012 08:32:06 -0400 Received: from mail.parknet.co.jp ([210.171.160.6]:42408 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754199Ab2IXMcE (ORCPT ); Mon, 24 Sep 2012 08:32:04 -0400 From: OGAWA Hirofumi To: Namjae Jeon Cc: akpm@linux-foundation.org, bfields@fieldses.org, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, Namjae Jeon , Ravishankar N , Amit Sahrawat Subject: Re: [PATCH v3 2/5] fat: allocate persistent inode numbers References: <1347798148-2660-1-git-send-email-linkinjeon@gmail.com> <87lig28fak.fsf@devron.myhome.or.jp> <87ipb45914.fsf@devron.myhome.or.jp> <87ehls53ug.fsf@devron.myhome.or.jp> <87a9wg53mc.fsf@devron.myhome.or.jp> <87392768dj.fsf@devron.myhome.or.jp> <87y5jz4rio.fsf@devron.myhome.or.jp> Date: Mon, 24 Sep 2012 21:32:00 +0900 In-Reply-To: (Namjae Jeon's message of "Mon, 24 Sep 2012 20:20:59 +0900") Message-ID: <87txun4n5r.fsf@devron.myhome.or.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Namjae Jeon writes: > 2012/9/24, OGAWA Hirofumi : >> Namjae Jeon writes: >> >>>> I see. fileid seems to be stat.ino on nfsd4. inode->i_ino is actually >>>> just a hash key of inode hash (exception is only in audit, iirc). >>>> >>>> So, what happens if we set "stat->ino = i_pos" on fat_getattr(). >>>> >>>> int fat_getattr(struct vfsmount *mnt, struct dentry *dentry, struct >>>> kstat >>>> *stat) >>>> { >>>> struct inode *inode = dentry->d_inode; >>>> generic_fillattr(inode, stat); >>>> stat->blksize = MSDOS_SB(inode->i_sb)->cluster_size; >>>> if (opts->nfs == FAT_NFS_LIMITED) { >>>> /* Use i_pos for ino. This is used as fileid of nfs. */ >>>> stat->ino = MSDOS_SB(inode->i_sb)->i_pos; >> >> stat->ino = fat_i_pos_read(MSDOS_SB(inode->i_sb), inode); >> >> Ouch, I forgot to use fat_i_pos_read(). >> > There is some unclear thing. > When I see first mail, I think maybe you don't want to use i_pos for inode->ino. > FAT allocate inode->ino from i_unique on server side and If NFS client > use i_pos for inode->ino in fat_get_attr, inode numbers on each > client/server will still be mismatched. > > Would you plz give me hint ? ->i_ino is long. It can't hold i_pos fully on 32bit arch, so we can't use ->i_no to store i_pos, and changing ->i_ino is unnecessary. If getattr() returned i_pos as ino, nobody see ->i_ino anymore except internal of kernel. Furthermore I think there is no issue even if server and client didn't have same ino. Because client just uses FH (nfs4 seems to be using stat.ino though). -- OGAWA Hirofumi