From patchwork Fri Nov 19 02:05:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Li Zefan X-Patchwork-Id: 338231 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAJ247E8029706 for ; Fri, 19 Nov 2010 02:04:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758185Ab0KSCDv (ORCPT ); Thu, 18 Nov 2010 21:03:51 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:54928 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754568Ab0KSCDu convert rfc822-to-8bit (ORCPT ); Thu, 18 Nov 2010 21:03:50 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 2545E170957; Fri, 19 Nov 2010 10:03:49 +0800 (CST) Received: from mailserver.fnst.cn.fujitus.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id oAJ1xHvb020713; Fri, 19 Nov 2010 09:59:21 +0800 Received: from lizf.localdomain ([10.167.225.51]) by mailserver.fnst.cn.fujitus.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2010111910041017-55095 ; Fri, 19 Nov 2010 10:04:10 +0800 Message-ID: <4CE5DB64.3010102@cn.fujitsu.com> Date: Fri, 19 Nov 2010 10:05:24 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= CC: linux-btrfs@vger.kernel.org Subject: Re: Symlinks' device numbers differ from regular files' References: <20101118235423.GC12925@toke.dk> In-Reply-To: <20101118235423.GC12925@toke.dk> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-11-19 10:04:10, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-11-19 10:04:10 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 19 Nov 2010 02:04:08 +0000 (UTC) ============= [PATCH] btrfs: Show device attr correctly for symlinks Symlinks and files of other types show different device numbers, though they are on the same partition: $ touch tmp; ln -s tmp tmp2; stat tmp tmp2 File: `tmp' Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: 15h/21d Inode: 984027 Links: 1 --- snip --- File: `tmp2' -> `tmp' Size: 3 Blocks: 0 IO Block: 4096 symbolic link Device: 13h/19d Inode: 984028 Links: 1 Reported-by: Toke Høiland-Jørgensen Signed-off-by: Li Zefan --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5132c9a..d10b6d4 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7139,6 +7139,7 @@ static const struct inode_operations btrfs_symlink_inode_operations = { .readlink = generic_readlink, .follow_link = page_follow_link_light, .put_link = page_put_link, + .getattr = btrfs_getattr, .permission = btrfs_permission, .setxattr = btrfs_setxattr, .getxattr = btrfs_getxattr,