diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-17 12:15:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-17 12:15:18 -0500 |
commit | 82abc2a97a4a3c7635c40e6dff571816062ec506 (patch) | |
tree | bdafbd1d1030a1d4717b52d07d8d0c3a37e8a693 /fs | |
parent | cb20c28a9c41052c2d7220325dae60c16f417ded (diff) | |
parent | 18dafac1a4c6c88867a50f9a82492976f20383d6 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
nilfs2: deleted inconsistent comment in nilfs_load_inode_block()
nilfs2: deleted struct nilfs_dat_group_desc
nilfs2: fix lock order reversal in chcp operation
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nilfs2/cpfile.c | 2 | ||||
-rw-r--r-- | fs/nilfs2/inode.c | 1 | ||||
-rw-r--r-- | fs/nilfs2/ioctl.c | 6 |
3 files changed, 5 insertions, 4 deletions
diff --git a/fs/nilfs2/cpfile.c b/fs/nilfs2/cpfile.c index 1c6cfb59128d..3f5d5d06f53c 100644 --- a/fs/nilfs2/cpfile.c +++ b/fs/nilfs2/cpfile.c | |||
@@ -871,7 +871,6 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode) | |||
871 | * exclusive with a new mount job. Though it doesn't cover | 871 | * exclusive with a new mount job. Though it doesn't cover |
872 | * umount, it's enough for the purpose. | 872 | * umount, it's enough for the purpose. |
873 | */ | 873 | */ |
874 | mutex_lock(&nilfs->ns_mount_mutex); | ||
875 | if (nilfs_checkpoint_is_mounted(nilfs, cno, 1)) { | 874 | if (nilfs_checkpoint_is_mounted(nilfs, cno, 1)) { |
876 | /* Current implementation does not have to protect | 875 | /* Current implementation does not have to protect |
877 | plain read-only mounts since they are exclusive | 876 | plain read-only mounts since they are exclusive |
@@ -880,7 +879,6 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode) | |||
880 | ret = -EBUSY; | 879 | ret = -EBUSY; |
881 | } else | 880 | } else |
882 | ret = nilfs_cpfile_clear_snapshot(cpfile, cno); | 881 | ret = nilfs_cpfile_clear_snapshot(cpfile, cno); |
883 | mutex_unlock(&nilfs->ns_mount_mutex); | ||
884 | return ret; | 882 | return ret; |
885 | case NILFS_SNAPSHOT: | 883 | case NILFS_SNAPSHOT: |
886 | return nilfs_cpfile_set_snapshot(cpfile, cno); | 884 | return nilfs_cpfile_set_snapshot(cpfile, cno); |
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 5040220c3732..2a0a5a3ac134 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -664,7 +664,6 @@ int nilfs_load_inode_block(struct nilfs_sb_info *sbi, struct inode *inode, | |||
664 | int err; | 664 | int err; |
665 | 665 | ||
666 | spin_lock(&sbi->s_inode_lock); | 666 | spin_lock(&sbi->s_inode_lock); |
667 | /* Caller of this function MUST lock s_inode_lock */ | ||
668 | if (ii->i_bh == NULL) { | 667 | if (ii->i_bh == NULL) { |
669 | spin_unlock(&sbi->s_inode_lock); | 668 | spin_unlock(&sbi->s_inode_lock); |
670 | err = nilfs_ifile_get_inode_block(sbi->s_ifile, inode->i_ino, | 669 | err = nilfs_ifile_get_inode_block(sbi->s_ifile, inode->i_ino, |
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index d24057d58f17..f6af76042d80 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c | |||
@@ -99,7 +99,8 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs, | |||
99 | static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, | 99 | static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, |
100 | unsigned int cmd, void __user *argp) | 100 | unsigned int cmd, void __user *argp) |
101 | { | 101 | { |
102 | struct inode *cpfile = NILFS_SB(inode->i_sb)->s_nilfs->ns_cpfile; | 102 | struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; |
103 | struct inode *cpfile = nilfs->ns_cpfile; | ||
103 | struct nilfs_transaction_info ti; | 104 | struct nilfs_transaction_info ti; |
104 | struct nilfs_cpmode cpmode; | 105 | struct nilfs_cpmode cpmode; |
105 | int ret; | 106 | int ret; |
@@ -109,14 +110,17 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, | |||
109 | if (copy_from_user(&cpmode, argp, sizeof(cpmode))) | 110 | if (copy_from_user(&cpmode, argp, sizeof(cpmode))) |
110 | return -EFAULT; | 111 | return -EFAULT; |
111 | 112 | ||
113 | mutex_lock(&nilfs->ns_mount_mutex); | ||
112 | nilfs_transaction_begin(inode->i_sb, &ti, 0); | 114 | nilfs_transaction_begin(inode->i_sb, &ti, 0); |
113 | ret = nilfs_cpfile_change_cpmode( | 115 | ret = nilfs_cpfile_change_cpmode( |
114 | cpfile, cpmode.cm_cno, cpmode.cm_mode); | 116 | cpfile, cpmode.cm_cno, cpmode.cm_mode); |
115 | if (unlikely(ret < 0)) { | 117 | if (unlikely(ret < 0)) { |
116 | nilfs_transaction_abort(inode->i_sb); | 118 | nilfs_transaction_abort(inode->i_sb); |
119 | mutex_unlock(&nilfs->ns_mount_mutex); | ||
117 | return ret; | 120 | return ret; |
118 | } | 121 | } |
119 | nilfs_transaction_commit(inode->i_sb); /* never fails */ | 122 | nilfs_transaction_commit(inode->i_sb); /* never fails */ |
123 | mutex_unlock(&nilfs->ns_mount_mutex); | ||
120 | return ret; | 124 | return ret; |
121 | } | 125 | } |
122 | 126 | ||