[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1363685478-9997-1-git-send-email-vdavydov@parallels.com>
Date: Tue, 19 Mar 2013 13:31:18 +0400
From: Vladimir Davydov <vdavydov@...allels.com>
To: Al Viro <viro@...iv.linux.org.uk>
CC: <linux-kernel@...r.kernel.org>, <devel@...nvz.org>,
Doug Ledford <dledford@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: [PATCH] mqueue: sys_mq_open: do not call mnt_drop_write() if read-only
mnt_drop_write() must be called only if mnt_want_write() succeeded,
otherwise the mnt_writers counter will diverge.
Signed-off-by: Vladimir Davydov <vdavydov@...allels.com>
Cc: Doug Ledford <dledford@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>
---
ipc/mqueue.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index e5c4f60..3953fda 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -840,7 +840,8 @@ out_putfd:
fd = error;
}
mutex_unlock(&root->d_inode->i_mutex);
- mnt_drop_write(mnt);
+ if (!ro)
+ mnt_drop_write(mnt);
out_putname:
putname(name);
return fd;
--
1.7.1
--
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