From patchwork Sat Apr 15 06:54:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 9682145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED27160388 for ; Sat, 15 Apr 2017 06:55:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC0E02623C for ; Sat, 15 Apr 2017 06:55:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D080E286AD; Sat, 15 Apr 2017 06:55:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EED192623C for ; Sat, 15 Apr 2017 06:55:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752550AbdDOGyu (ORCPT ); Sat, 15 Apr 2017 02:54:50 -0400 Received: from mailrelay111.isp.belgacom.be ([195.238.20.138]:48149 "EHLO mailrelay111.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbdDOGyr (ORCPT ); Sat, 15 Apr 2017 02:54:47 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AVT7gCxQ96M347ju58O54RYDUL9psv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa64ZBSN2/xhgRfzUJnB7Loc0qyN7PCmBDRIyK3CmU5BWaQEbwUCh8?= =?us-ascii?q?QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnY6Uy/yPgtt?= =?us-ascii?q?J+nzBpWaz4Huj7jzqNXvZFBhgjanbKw6CRKssQLX/p0fgpNnAqIwzAbZ53VPZu?= =?us-ascii?q?JazH9pIlTVmAzzsJSe5plmpgpZsfMo8YZuS6j2cr45Rr8QWDovOW4d/876sxTf?= =?us-ascii?q?CwGCsChPGl4KmwZFVlCWpCrxWY38526j7rJw?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2D/AQCjwvFY/xWMtFtdHAELAQUBgmpqJ?= =?us-ascii?q?4FFjm6RFAGVNYIPIYYDhABAGAEBAQEBAQEBAQEBaiiCMwQBHQEEgmkvIylxJBO?= =?us-ascii?q?KChGrBTqEEIc0hlKBXYsKgkoFnRuSWA2RRpQKHziBBUMdGIRaAYJQPjWHeYFPA?= =?us-ascii?q?QEB?= X-IPAS-Result: =?us-ascii?q?A2D/AQCjwvFY/xWMtFtdHAELAQUBgmpqJ4FFjm6RFAGVNYI?= =?us-ascii?q?PIYYDhABAGAEBAQEBAQEBAQEBaiiCMwQBHQEEgmkvIylxJBOKChGrBTqEEIc0h?= =?us-ascii?q?lKBXYsKgkoFnRuSWA2RRpQKHziBBUMdGIRaAYJQPjWHeYFPAQEB?= Received: from 21.140-180-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.180.140.21]) by relay.skynet.be with ESMTP; 15 Apr 2017 08:54:45 +0200 From: Fabian Frederick To: Andrew Morton Cc: Duane Griffin , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, fabf@skynet.be Subject: [PATCH 1/1 linux-next] fs/affs: bugfix: make symbolic links work again Date: Sat, 15 Apr 2017 08:54:36 +0200 Message-Id: <20170415065436.13518-1-fabf@skynet.be> X-Mailer: git-send-email 2.9.3 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP AFFS symbolic links were broken since kernel 2.6.29 Problem was bisected to the following commit ebd09abbd969 ("vfs: ensure page symlinks are NUL-terminated") commit 035146851cfa ("vfs: introduce helper function to safely NUL-terminate symlinks") AFFS wasn't setting inode size when reading symbolic link from disk or creating a new one. Result was zero allocation in pagecache. ln -s file symlink ls -lrt file symlink -> This patch adds inode isize information on inode get and symbolic link addition. Signed-off-by: Fabian Frederick --- fs/affs/inode.c | 1 + fs/affs/namei.c | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/affs/inode.c b/fs/affs/inode.c index abcc598..fd4ef3c 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inode.c @@ -140,6 +140,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino) inode->i_fop = &affs_file_operations; break; case ST_SOFTLINK: + inode->i_size = strlen((char *)AFFS_HEAD(bh)->table); inode->i_mode |= S_IFLNK; inode_nohighmem(inode); inode->i_op = &affs_symlink_inode_operations; diff --git a/fs/affs/namei.c b/fs/affs/namei.c index 96dd1d0..b02da4d 100644 --- a/fs/affs/namei.c +++ b/fs/affs/namei.c @@ -365,6 +365,7 @@ affs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) symname++; } *p = 0; + inode->i_size = i + 1; mark_buffer_dirty_inode(bh, inode); affs_brelse(bh); mark_inode_dirty(inode);