[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANZZXhCCUh12_1gt0ppc4cMMR-BUsq4rySqNihsEJziOGYbh3A@mail.gmail.com>
Date: Fri, 20 Mar 2015 15:17:54 +0200
From: Vitaly Chernooky <vitalii.chernookyi@...ballogic.com>
To: Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: David Vrabel <david.vrabel@...rix.com>,
Marek Marczykowski-Górecki
<marmarek@...isiblethingslab.com>,
Iurii Konovalenko <iurii.konovalenko@...ballogic.com>,
Ian Campbell <ian.campbell@...rix.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Andrii Anisov <andrii.anisov@...ballogic.com>,
Artem Mygaiev <artem.mygaiev@...ballogic.com>
Subject: [PATCH] [RFC] Fix deadlock on regular nonseekable files
>From 8ef72cde695d1b1a3e9f6165477c9e7415fca2b1 Mon Sep 17 00:00:00 2001
From: Vitaly Chernooky <vitaly.chernooky@...ballogic.com>
Date: Fri, 20 Mar 2015 12:26:37 +0200
Subject: [PATCH] Fix deadlock on regular nonseekable files
'Commit 9c225f2655e36a470c4f58dbbc99244c5fc7f2d4 ("vfs: atomic f_pos
accesses as per POSIX")' introduce following regression. If some program
does multithreaded IO on file in pseudo-filesystem, like procfs, with
nonseekable files marked as regular, we get deadlock on f_pos_lock
mutex, if there are simultaneous reading and writing by different
threads.
Signed-off-by: Vitaly Chernooky <vitaly.chernooky@...ballogic.com>
---
fs/open.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/open.c b/fs/open.c
index 33f9cbf..1a4f84b 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1135,7 +1135,7 @@ EXPORT_SYMBOL(generic_file_open);
*/
int nonseekable_open(struct inode *inode, struct file *filp)
{
- filp->f_mode &= ~(FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE);
+ filp->f_mode &= ~(FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE |
FMODE_ATOMIC_POS);
return 0;
}
--
1.7.9.5
With best regards,
--
Vitaly Chernooky | Senior Developer - Product Engineering and Development
GlobalLogic
P +380.44.4929695 ext.1136 M +380.63.6011802 S cvv_2k
www.globallogic.com
http://www.globallogic.com/email_disclaimer.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists