aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r--fs/reiserfs/inode.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 1150ebb2536f..2df0f5c7c60b 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -1497,9 +1497,11 @@ struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key)
1497 1497
1498 args.objectid = key->on_disk_key.k_objectid; 1498 args.objectid = key->on_disk_key.k_objectid;
1499 args.dirid = key->on_disk_key.k_dir_id; 1499 args.dirid = key->on_disk_key.k_dir_id;
1500 reiserfs_write_unlock(s);
1500 inode = iget5_locked(s, key->on_disk_key.k_objectid, 1501 inode = iget5_locked(s, key->on_disk_key.k_objectid,
1501 reiserfs_find_actor, reiserfs_init_locked_inode, 1502 reiserfs_find_actor, reiserfs_init_locked_inode,
1502 (void *)(&args)); 1503 (void *)(&args));
1504 reiserfs_write_lock(s);
1503 if (!inode) 1505 if (!inode)
1504 return ERR_PTR(-ENOMEM); 1506 return ERR_PTR(-ENOMEM);
1505 1507
@@ -3062,13 +3064,14 @@ static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb,
3062int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) 3064int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
3063{ 3065{
3064 struct inode *inode = dentry->d_inode; 3066 struct inode *inode = dentry->d_inode;
3065 int error;
3066 unsigned int ia_valid; 3067 unsigned int ia_valid;
3068 int depth;
3069 int error;
3067 3070
3068 /* must be turned off for recursive notify_change calls */ 3071 /* must be turned off for recursive notify_change calls */
3069 ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID); 3072 ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID);
3070 3073
3071 reiserfs_write_lock(inode->i_sb); 3074 depth = reiserfs_write_lock_once(inode->i_sb);
3072 if (attr->ia_valid & ATTR_SIZE) { 3075 if (attr->ia_valid & ATTR_SIZE) {
3073 /* version 2 items will be caught by the s_maxbytes check 3076 /* version 2 items will be caught by the s_maxbytes check
3074 ** done for us in vmtruncate 3077 ** done for us in vmtruncate
@@ -3149,8 +3152,17 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
3149 journal_end(&th, inode->i_sb, jbegin_count); 3152 journal_end(&th, inode->i_sb, jbegin_count);
3150 } 3153 }
3151 } 3154 }
3152 if (!error) 3155 if (!error) {
3156 /*
3157 * Relax the lock here, as it might truncate the
3158 * inode pages and wait for inode pages locks.
3159 * To release such page lock, the owner needs the
3160 * reiserfs lock
3161 */
3162 reiserfs_write_unlock_once(inode->i_sb, depth);
3153 error = inode_setattr(inode, attr); 3163 error = inode_setattr(inode, attr);
3164 depth = reiserfs_write_lock_once(inode->i_sb);
3165 }
3154 } 3166 }
3155 3167
3156 if (!error && reiserfs_posixacl(inode->i_sb)) { 3168 if (!error && reiserfs_posixacl(inode->i_sb)) {
@@ -3159,7 +3171,8 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
3159 } 3171 }
3160 3172
3161 out: 3173 out:
3162 reiserfs_write_unlock(inode->i_sb); 3174 reiserfs_write_unlock_once(inode->i_sb, depth);
3175
3163 return error; 3176 return error;
3164} 3177}
3165 3178