aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-13 20:00:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-13 20:00:50 -0400
commitcd7945397d4784318668fbbbfa99e4c6fcf30b3b (patch)
tree16dc1b5d84dea20d062153b30a70ee9ec85f43ba
parent2f1c2b8155865ba3c2909f468ac8be60f52ed56b (diff)
parent310fa7a36722017088af123043ebd231cd6bc559 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro: "A bunch of assorted fixes; Jan's freezing stuff still _not_ in there and neither is mm fun ;-/" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: restore smp_mb() in unlock_new_inode() vfs: fix return value from do_last() vfs: fix double put after complete_walk() udf: Fix deadlock in udf_release_file() vfs: Correctly set the dir i_mutex lockdep class
-rw-r--r--fs/inode.c4
-rw-r--r--fs/namei.c4
-rw-r--r--fs/udf/file.c2
3 files changed, 4 insertions, 6 deletions
diff --git a/fs/inode.c b/fs/inode.c
index d3ebdbe723d0..83ab215baab1 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -938,8 +938,7 @@ void lockdep_annotate_inode_mutex_key(struct inode *inode)
938 struct file_system_type *type = inode->i_sb->s_type; 938 struct file_system_type *type = inode->i_sb->s_type;
939 939
940 /* Set new key only if filesystem hasn't already changed it */ 940 /* Set new key only if filesystem hasn't already changed it */
941 if (!lockdep_match_class(&inode->i_mutex, 941 if (lockdep_match_class(&inode->i_mutex, &type->i_mutex_key)) {
942 &type->i_mutex_key)) {
943 /* 942 /*
944 * ensure nobody is actually holding i_mutex 943 * ensure nobody is actually holding i_mutex
945 */ 944 */
@@ -966,6 +965,7 @@ void unlock_new_inode(struct inode *inode)
966 spin_lock(&inode->i_lock); 965 spin_lock(&inode->i_lock);
967 WARN_ON(!(inode->i_state & I_NEW)); 966 WARN_ON(!(inode->i_state & I_NEW));
968 inode->i_state &= ~I_NEW; 967 inode->i_state &= ~I_NEW;
968 smp_mb();
969 wake_up_bit(&inode->i_state, __I_NEW); 969 wake_up_bit(&inode->i_state, __I_NEW);
970 spin_unlock(&inode->i_lock); 970 spin_unlock(&inode->i_lock);
971} 971}
diff --git a/fs/namei.c b/fs/namei.c
index e2ba62820a0f..46ea9cc16647 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2162,7 +2162,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
2162 /* sayonara */ 2162 /* sayonara */
2163 error = complete_walk(nd); 2163 error = complete_walk(nd);
2164 if (error) 2164 if (error)
2165 return ERR_PTR(-ECHILD); 2165 return ERR_PTR(error);
2166 2166
2167 error = -ENOTDIR; 2167 error = -ENOTDIR;
2168 if (nd->flags & LOOKUP_DIRECTORY) { 2168 if (nd->flags & LOOKUP_DIRECTORY) {
@@ -2261,7 +2261,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
2261 /* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */ 2261 /* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */
2262 error = complete_walk(nd); 2262 error = complete_walk(nd);
2263 if (error) 2263 if (error)
2264 goto exit; 2264 return ERR_PTR(error);
2265 error = -EISDIR; 2265 error = -EISDIR;
2266 if (S_ISDIR(nd->inode->i_mode)) 2266 if (S_ISDIR(nd->inode->i_mode))
2267 goto exit; 2267 goto exit;
diff --git a/fs/udf/file.c b/fs/udf/file.c
index dca0c3881e82..d567b8448dfc 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -201,12 +201,10 @@ out:
201static int udf_release_file(struct inode *inode, struct file *filp) 201static int udf_release_file(struct inode *inode, struct file *filp)
202{ 202{
203 if (filp->f_mode & FMODE_WRITE) { 203 if (filp->f_mode & FMODE_WRITE) {
204 mutex_lock(&inode->i_mutex);
205 down_write(&UDF_I(inode)->i_data_sem); 204 down_write(&UDF_I(inode)->i_data_sem);
206 udf_discard_prealloc(inode); 205 udf_discard_prealloc(inode);
207 udf_truncate_tail_extent(inode); 206 udf_truncate_tail_extent(inode);
208 up_write(&UDF_I(inode)->i_data_sem); 207 up_write(&UDF_I(inode)->i_data_sem);
209 mutex_unlock(&inode->i_mutex);
210 } 208 }
211 return 0; 209 return 0;
212} 210}