Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9656b2c14c6ee0806c90a6be41dec71117fc8f50
Commit:     9656b2c14c6ee0806c90a6be41dec71117fc8f50
Parent:     0811a127cb83ad2e0355e5e3e30164d7ef0f2d65
Author:     Steven Whitehouse <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 8 08:14:30 2008 +0000
Committer:  Steven Whitehouse <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 08:17:31 2008 +0000

    [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 <[EMAIL PROTECTED]>
    Cc: Abhijith Das <[EMAIL PROTECTED]>
---
 fs/gfs2/ops_address.c |   13 +++++--------
 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 e16ad81..37406a3 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,
 
        ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata);
 
-       if (likely(ret >= 0)) {
-               copied = ret;
-               if  ((pos + copied) > inode->i_size) {
-                       di = (struct gfs2_dinode *)dibh->b_data;
-                       ip->i_di.di_size = inode->i_size;
-                       di->di_size = cpu_to_be64(inode->i_size);
-                       mark_inode_dirty(inode);
-               }
+       if (likely(ret >= 0) && (inode->i_size > ip->i_di.di_size)) {
+               di = (struct gfs2_dinode *)dibh->b_data;
+               ip->i_di.di_size = inode->i_size;
+               di->di_size = cpu_to_be64(inode->i_size);
+               mark_inode_dirty(inode);
        }
 
        if (inode == sdp->sd_rindex)
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 291f0c7..8386ab3 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,
        if (inode && IS_ERR(inode))
                return ERR_PTR(PTR_ERR(inode));
 
-       if (inode)
+       if (inode) {
+               struct gfs2_glock *gl = GFS2_I(inode)->i_gl;
+               struct gfs2_holder gh;
+               int error;
+               error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &gh);
+               if (error) {
+                       iput(inode);
+                       return ERR_PTR(error);
+               }
+               gfs2_glock_dq_uninit(&gh);
                return d_splice_alias(inode, dentry);
+       }
        d_add(dentry, inode);
 
        return NULL;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to