From: Martin Brandenburg <martin@xxxxxxxxxxxx> Signed-off-by: Martin Brandenburg <martin@xxxxxxxxxxxx> --- fs/orangefs/file.c | 4 +--- fs/orangefs/namei.c | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index afb94ed7cef3..8dfa0e8c7326 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -574,8 +574,6 @@ static int orangefs_file_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -#define mapping_nrpages(idata) ((idata)->nrpages) - /* * Called to notify the module that there are no more references to * this file (i.e. no processes have it open). @@ -595,7 +593,7 @@ static int orangefs_file_release(struct inode *inode, struct file *file) */ if (file_inode(file) && file_inode(file)->i_mapping && - mapping_nrpages(&file_inode(file)->i_data)) { + file_inode(file)->i_mapping->nrpages) { if (orangefs_features & ORANGEFS_FEATURE_READAHEAD) { gossip_debug(GOSSIP_INODE_DEBUG, "calling flush_racache on %pU\n", diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c index f79401b2486a..d3a62e52c724 100644 --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@ -330,6 +330,8 @@ static int orangefs_symlink(struct inode *dir, "Assigned symlink inode new number of %pU\n", get_khandle_from_ino(inode)); + inode->i_size = strlen(symname); + d_instantiate(dentry, inode); unlock_new_inode(inode); orangefs_set_timeout(dentry); @@ -398,6 +400,8 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode "Assigned dir inode new number of %pU\n", get_khandle_from_ino(inode)); + inode->i_size = PAGE_SIZE; + d_instantiate(dentry, inode); unlock_new_inode(inode); orangefs_set_timeout(dentry); -- 2.15.1