aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_address.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-01-08 03:14:30 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:17:31 -0500
commit9656b2c14c6ee0806c90a6be41dec71117fc8f50 (patch)
tree3e093571e695bf780885f36caec9594392da31fc /fs/gfs2/ops_address.c
parent0811a127cb83ad2e0355e5e3e30164d7ef0f2d65 (diff)
[GFS2] Fix problems relating to execution of files on GFS2
This patch fixes a couple of problems which affected the execution of files on GFS2. The first is that there was a corner case where inodes were not always uptodate at the point at which permissions checks were being carried out, this was resulting in refusal of execute permission, but only on the first lookup, subsequent requests worked correctly. The second was a problem relating to incorrect updating of file sizes which was introduced with the write_begin/end code for GFS2 a little while back. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Abhijith Das <adas@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_address.c')
-rw-r--r--fs/gfs2/ops_address.c13
1 files changed, 5 insertions, 8 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)