Gentoo Archives: gentoo-commits

From: "Sergei Trofimovich (slyfox)" <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/mtpfs/files: mtpfs-1.1-fix-mutex-crash.patch
Date: Sat, 30 May 2015 22:33:32
Message-Id: 20150530223327.66F77A17@oystercatcher.gentoo.org
1 slyfox 15/05/30 22:33:27
2
3 Added: mtpfs-1.1-fix-mutex-crash.patch
4 Log:
5 Fixed crash on double mutex unlock for mtpfs_getattr_real(). Added myself to co-maintainers.
6
7 (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)
8
9 Revision Changes Path
10 1.1 sys-fs/mtpfs/files/mtpfs-1.1-fix-mutex-crash.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mtpfs/files/mtpfs-1.1-fix-mutex-crash.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/mtpfs/files/mtpfs-1.1-fix-mutex-crash.patch?rev=1.1&content-type=text/plain
14
15 Index: mtpfs-1.1-fix-mutex-crash.patch
16 ===================================================================
17 commit c30d53648a713a3f7f7711f081732aa814c6e74d
18 Author: Sergei Trofimovich <siarheit@××××××.com>
19 Date: Sat May 30 23:20:42 2015 +0100
20
21 mtpfs.c: remove all unlocking calls from mtpfs_getattr_real
22
23 Lock is already acquired/freed in the caller function 'mtpfs_getattr'.
24 Noticed when trying to use mtpfs today :)
25
26 Should also fix the same issue https://github.com/cjd/mtpfs/issues/1
27 as I get the same backtrace.
28
29 Signed-off-by: Sergei Trofimovich <siarheit@××××××.com>
30
31 diff --git a/mtpfs.c b/mtpfs.c
32 index e5e1b03..553d282 100644
33 --- a/mtpfs.c
34 +++ b/mtpfs.c
35 @@ -776,5 +776,5 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
36 {
37 int ret = 0;
38 - if (path==NULL) return_unlock(-ENOENT);
39 + if (path==NULL) return -ENOENT;
40 memset (stbuf, 0, sizeof (struct stat));
41
42 @@ -787,5 +787,5 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
43 stbuf->st_mode = S_IFDIR | 0777;
44 stbuf->st_nlink = 2;
45 - return_unlock(0);
46 + return 0;
47 }
48
49 @@ -799,5 +799,5 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
50 stbuf->st_blocks = 2;
51 stbuf->st_mtime = time(NULL);
52 - return_unlock(0);
53 + return 0;
54 }
55 }
56 @@ -808,5 +808,5 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
57 stbuf->st_mode = S_IFDIR | 0777;
58 stbuf->st_nlink = 2;
59 - return_unlock(0);
60 + return 0;
61 }
62
63 @@ -843,9 +843,9 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
64 stbuf->st_blocks = 2;
65 stbuf->st_mtime = time(NULL);
66 - return_unlock(0);
67 + return 0;
68 }
69 playlist = playlist->next;
70 }
71 - return_unlock(-ENOENT);
72 + return -ENOENT;
73 }
74
75 @@ -864,9 +864,9 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
76 stbuf->st_mode = S_IFREG | 0777;
77 stbuf->st_mtime = file->modificationdate;
78 - return_unlock(0);
79 + return 0;
80 }
81 }
82
83 - return_unlock(-ENOENT);
84 + return -ENOENT;
85 }