Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba6a46a03f3c46ed68be551c722161bb37caf095
Commit:     ba6a46a03f3c46ed68be551c722161bb37caf095
Parent:     3677db10a635a39f63ea509f8f0056d95589ff90
Author:     Steve French <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 26 20:06:29 2007 +0000
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Mon Feb 26 20:06:29 2007 +0000

    [CIFS] small piece missing from previous patch
    
    There were two i_size_writes in the new truncate
    function - we missed one in the last patch.
    Noticed by Shaggy when he reviewed.
    
    Thank you Shaggy ...
    
    CC: Shaggy <[EMAIL PROTECTED]>
    Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/inode.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 24df13a..03ade0f 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1139,15 +1139,17 @@ int cifs_vmtruncate(struct inode * inode, loff_t offset)
        struct address_space *mapping = inode->i_mapping;
        unsigned long limit;
 
+       spin_lock(&inode->i_lock);
        if (inode->i_size < offset)
                goto do_expand;
        /*
         * truncation of in-use swapfiles is disallowed - it would cause
         * subsequent swapout to scribble on the now-freed blocks.
         */
-       if (IS_SWAPFILE(inode))
+       if (IS_SWAPFILE(inode)) {
+               spin_unlock(&inode->i_lock);
                goto out_busy;
-       spin_lock(&inode->i_lock);              
+       }
        i_size_write(inode, offset);
        spin_unlock(&inode->i_lock);
        unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1);
@@ -1156,12 +1158,16 @@ int cifs_vmtruncate(struct inode * inode, loff_t offset)
 
 do_expand:
        limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
-       if (limit != RLIM_INFINITY && offset > limit)
+       if (limit != RLIM_INFINITY && offset > limit) {
+               spin_unlock(&inode->i_lock);
                goto out_sig;
-       if (offset > inode->i_sb->s_maxbytes)
+       }
+       if (offset > inode->i_sb->s_maxbytes) {
+               spin_unlock(&inode->i_lock);
                goto out_big;
+       }
        i_size_write(inode, offset);
-
+       spin_unlock(&inode->i_lock);
 out_truncate:
        if (inode->i_op && inode->i_op->truncate)
                inode->i_op->truncate(inode);
-
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