diff options
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/ops_address.c | 13 | ||||
-rw-r--r-- | fs/gfs2/ops_inode.c | 12 |
2 files changed, 16 insertions, 9 deletions
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c index e16ad8104495..37406a379e7a 100644 --- a/fs/gfs2/ops_address.c +++ b/fs/gfs2/ops_address.c | |||
@@ -848,14 +848,11 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping, | |||
848 | 848 | ||
849 | ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata); | 849 | ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata); |
850 | 850 | ||
851 | if (likely(ret >= 0)) { | 851 | if (likely(ret >= 0) && (inode->i_size > ip->i_di.di_size)) { |
852 | copied = ret; | 852 | di = (struct gfs2_dinode *)dibh->b_data; |
853 | if ((pos + copied) > inode->i_size) { | 853 | ip->i_di.di_size = inode->i_size; |
854 | di = (struct gfs2_dinode *)dibh->b_data; | 854 | di->di_size = cpu_to_be64(inode->i_size); |
855 | ip->i_di.di_size = inode->i_size; | 855 | mark_inode_dirty(inode); |
856 | di->di_size = cpu_to_be64(inode->i_size); | ||
857 | mark_inode_dirty(inode); | ||
858 | } | ||
859 | } | 856 | } |
860 | 857 | ||
861 | if (inode == sdp->sd_rindex) | 858 | if (inode == sdp->sd_rindex) |
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 291f0c7eaa3b..8386ab323e33 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -113,8 +113,18 @@ static struct dentry *gfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
113 | if (inode && IS_ERR(inode)) | 113 | if (inode && IS_ERR(inode)) |
114 | return ERR_PTR(PTR_ERR(inode)); | 114 | return ERR_PTR(PTR_ERR(inode)); |
115 | 115 | ||
116 | if (inode) | 116 | if (inode) { |
117 | struct gfs2_glock *gl = GFS2_I(inode)->i_gl; | ||
118 | struct gfs2_holder gh; | ||
119 | int error; | ||
120 | error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); | ||
121 | if (error) { | ||
122 | iput(inode); | ||
123 | return ERR_PTR(error); | ||
124 | } | ||
125 | gfs2_glock_dq_uninit(&gh); | ||
117 | return d_splice_alias(inode, dentry); | 126 | return d_splice_alias(inode, dentry); |
127 | } | ||
118 | d_add(dentry, inode); | 128 | d_add(dentry, inode); |
119 | 129 | ||
120 | return NULL; | 130 | return NULL; |