aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2010-04-27 00:38:15 -0400
committerSteve French <sfrench@us.ibm.com>2010-04-27 00:38:15 -0400
commitd54ff73259a852d4b3886dc586587fdef5e9c8de (patch)
tree417ed0f9b87e4187641b053892eeb8f32ec32746 /fs/cifs
parent9bf67e516f16d31f86aa6f063576a959bbf19990 (diff)
[CIFS] Fix lease break for writes
On lease break we were breaking to readonly leases always even if write requested. Also removed experimental ifdef around setlease code Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsfs.c12
-rw-r--r--fs/cifs/cifsfs.h2
-rw-r--r--fs/cifs/file.c6
3 files changed, 3 insertions, 17 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 440e98ca01e3..80a93562b47a 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -645,7 +645,6 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
645 return generic_file_llseek_unlocked(file, offset, origin); 645 return generic_file_llseek_unlocked(file, offset, origin);
646} 646}
647 647
648#ifdef CONFIG_CIFS_EXPERIMENTAL
649static int cifs_setlease(struct file *file, long arg, struct file_lock **lease) 648static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
650{ 649{
651 /* note that this is called by vfs setlease with the BKL held 650 /* note that this is called by vfs setlease with the BKL held
@@ -674,7 +673,6 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
674 else 673 else
675 return -EAGAIN; 674 return -EAGAIN;
676} 675}
677#endif
678 676
679struct file_system_type cifs_fs_type = { 677struct file_system_type cifs_fs_type = {
680 .owner = THIS_MODULE, 678 .owner = THIS_MODULE,
@@ -751,10 +749,7 @@ const struct file_operations cifs_file_ops = {
751#ifdef CONFIG_CIFS_POSIX 749#ifdef CONFIG_CIFS_POSIX
752 .unlocked_ioctl = cifs_ioctl, 750 .unlocked_ioctl = cifs_ioctl,
753#endif /* CONFIG_CIFS_POSIX */ 751#endif /* CONFIG_CIFS_POSIX */
754
755#ifdef CONFIG_CIFS_EXPERIMENTAL
756 .setlease = cifs_setlease, 752 .setlease = cifs_setlease,
757#endif /* CONFIG_CIFS_EXPERIMENTAL */
758}; 753};
759 754
760const struct file_operations cifs_file_direct_ops = { 755const struct file_operations cifs_file_direct_ops = {
@@ -773,9 +768,7 @@ const struct file_operations cifs_file_direct_ops = {
773 .unlocked_ioctl = cifs_ioctl, 768 .unlocked_ioctl = cifs_ioctl,
774#endif /* CONFIG_CIFS_POSIX */ 769#endif /* CONFIG_CIFS_POSIX */
775 .llseek = cifs_llseek, 770 .llseek = cifs_llseek,
776#ifdef CONFIG_CIFS_EXPERIMENTAL
777 .setlease = cifs_setlease, 771 .setlease = cifs_setlease,
778#endif /* CONFIG_CIFS_EXPERIMENTAL */
779}; 772};
780const struct file_operations cifs_file_nobrl_ops = { 773const struct file_operations cifs_file_nobrl_ops = {
781 .read = do_sync_read, 774 .read = do_sync_read,
@@ -792,10 +785,7 @@ const struct file_operations cifs_file_nobrl_ops = {
792#ifdef CONFIG_CIFS_POSIX 785#ifdef CONFIG_CIFS_POSIX
793 .unlocked_ioctl = cifs_ioctl, 786 .unlocked_ioctl = cifs_ioctl,
794#endif /* CONFIG_CIFS_POSIX */ 787#endif /* CONFIG_CIFS_POSIX */
795
796#ifdef CONFIG_CIFS_EXPERIMENTAL
797 .setlease = cifs_setlease, 788 .setlease = cifs_setlease,
798#endif /* CONFIG_CIFS_EXPERIMENTAL */
799}; 789};
800 790
801const struct file_operations cifs_file_direct_nobrl_ops = { 791const struct file_operations cifs_file_direct_nobrl_ops = {
@@ -813,9 +803,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
813 .unlocked_ioctl = cifs_ioctl, 803 .unlocked_ioctl = cifs_ioctl,
814#endif /* CONFIG_CIFS_POSIX */ 804#endif /* CONFIG_CIFS_POSIX */
815 .llseek = cifs_llseek, 805 .llseek = cifs_llseek,
816#ifdef CONFIG_CIFS_EXPERIMENTAL
817 .setlease = cifs_setlease, 806 .setlease = cifs_setlease,
818#endif /* CONFIG_CIFS_EXPERIMENTAL */
819}; 807};
820 808
821const struct file_operations cifs_dir_ops = { 809const struct file_operations cifs_dir_ops = {
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index dac76022c5fe..0242ff9cbf41 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -114,5 +114,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
114extern const struct export_operations cifs_export_ops; 114extern const struct export_operations cifs_export_ops;
115#endif /* EXPERIMENTAL */ 115#endif /* EXPERIMENTAL */
116 116
117#define CIFS_VERSION "1.63" 117#define CIFS_VERSION "1.64"
118#endif /* _CIFSFS_H */ 118#endif /* _CIFSFS_H */
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5f1f7682256b..d53d6308bf3a 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2306,12 +2306,10 @@ cifs_oplock_break(struct slow_work *work)
2306 int rc, waitrc = 0; 2306 int rc, waitrc = 0;
2307 2307
2308 if (inode && S_ISREG(inode->i_mode)) { 2308 if (inode && S_ISREG(inode->i_mode)) {
2309#ifdef CONFIG_CIFS_EXPERIMENTAL 2309 if (cinode->clientCanCacheRead)
2310 if (cinode->clientCanCacheAll == 0)
2311 break_lease(inode, O_RDONLY); 2310 break_lease(inode, O_RDONLY);
2312 else if (cinode->clientCanCacheRead == 0) 2311 else
2313 break_lease(inode, O_WRONLY); 2312 break_lease(inode, O_WRONLY);
2314#endif
2315 rc = filemap_fdatawrite(inode->i_mapping); 2313 rc = filemap_fdatawrite(inode->i_mapping);
2316 if (cinode->clientCanCacheRead == 0) { 2314 if (cinode->clientCanCacheRead == 0) {
2317 waitrc = filemap_fdatawait(inode->i_mapping); 2315 waitrc = filemap_fdatawait(inode->i_mapping);