From b20af7f665000c00bb7d70d9412d1dc7a7de7c6f Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 10 Feb 2004 21:36:35 +0000 Subject: [PATCH] Update b_bug974 from HEAD (20040210_1406) (b_smallfix landing) --- .../patches/ext3-truncate-buffer-head.patch | 2 +- lustre/smfs/symlink.c | 25 +++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch b/lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch index f6be984..3741213 100644 --- a/lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch +++ b/lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch @@ -4,7 +4,7 @@ if (ext3_should_order_data(inode)) err = ext3_journal_dirty_data(handle, bh, 0); __mark_buffer_dirty(bh); -+ buffer_insert_inode_data_queue(bh, inode); ++ buffer_insert_inode_data_queue(bh, inode); } unlock: diff --git a/lustre/smfs/symlink.c b/lustre/smfs/symlink.c index 72c68f4..f590852 100644 --- a/lustre/smfs/symlink.c +++ b/lustre/smfs/symlink.c @@ -16,28 +16,47 @@ static int smfs_readlink(struct dentry * dentry, char * buffer, int buflen) { struct inode *cache_inode = I2CI(dentry->d_inode); - int rc = 0; + struct dentry cache_dentry; + int rc = 0; + if (!cache_inode) + RETURN(-ENOENT); + + smfs_prepare_dentry(&cache_dentry, NULL, &dentry->d_name); + d_add(&cache_dentry, cache_inode); + if (cache_inode->i_op && cache_inode->i_op->readlink) - rc = cache_inode->i_op->readlink(dentry, buffer, buflen); + rc = cache_inode->i_op->readlink(&cache_dentry, buffer, buflen); + smfs_clear_dentry(&cache_dentry); return rc; } static int smfs_follow_link(struct dentry *dentry, struct nameidata *nd) { struct inode *cache_inode = I2CI(dentry->d_inode); + struct dentry cache_dentry; int rc = 0; + if (!cache_inode) + RETURN(-ENOENT); + + smfs_prepare_dentry(&cache_dentry, NULL, &dentry->d_name); + d_add(&cache_dentry, cache_inode); if (cache_inode->i_op && cache_inode->i_op->follow_link) - rc = cache_inode->i_op->follow_link(dentry, nd); + rc = cache_inode->i_op->follow_link(&cache_dentry, nd); + smfs_clear_dentry(&cache_dentry); return rc; } struct inode_operations smfs_sym_iops = { readlink: smfs_readlink, follow_link: smfs_follow_link, + setxattr: smfs_setxattr, /* BKL held */ + getxattr: smfs_getxattr, /* BKL held */ + listxattr: smfs_listxattr, /* BKL held */ + removexattr: smfs_removexattr, /* BKL held */ }; struct file_operations smfs_sym_fops = { -- 1.8.3.1