]>
Commit | Line | Data |
---|---|---|
9ae184f0 GKH |
1 | From 9d05746e7b16d8565dddbe3200faa1e669d23bbf Mon Sep 17 00:00:00 2001 |
2 | From: Linus Torvalds <torvalds@linux-foundation.org> | |
3 | Date: Mon, 30 Sep 2013 08:35:10 -0700 | |
4 | Subject: vfs: allow O_PATH file descriptors for fstatfs() | |
5 | ||
6 | From: Linus Torvalds <torvalds@linux-foundation.org> | |
7 | ||
8 | commit 9d05746e7b16d8565dddbe3200faa1e669d23bbf upstream. | |
9 | ||
10 | Olga reported that file descriptors opened with O_PATH do not work with | |
11 | fstatfs(), found during further development of ksh93's thread support. | |
12 | ||
13 | There is no reason to not allow O_PATH file descriptors here (fstatfs is | |
14 | very much a path operation), so use "fdget_raw()". See commit | |
15 | 55815f70147d ("vfs: make O_PATH file descriptors usable for 'fstat()'") | |
16 | for a very similar issue reported for fstat() by the same team. | |
17 | ||
18 | Reported-and-tested-by: ольга крыжановская <olga.kryzhanovska@gmail.com> | |
19 | Acked-by: Al Viro <viro@zeniv.linux.org.uk> | |
20 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | |
21 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
22 | ||
23 | --- | |
24 | fs/statfs.c | 2 +- | |
25 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
26 | ||
27 | --- a/fs/statfs.c | |
28 | +++ b/fs/statfs.c | |
29 | @@ -94,7 +94,7 @@ retry: | |
30 | ||
31 | int fd_statfs(int fd, struct kstatfs *st) | |
32 | { | |
33 | - struct fd f = fdget(fd); | |
34 | + struct fd f = fdget_raw(fd); | |
35 | int error = -EBADF; | |
36 | if (f.file) { | |
37 | error = vfs_statfs(&f.file->f_path, st); |