Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9e87dd22
Commit
9e87dd22
authored
Feb 18, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Feb 18, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] (2/4) 2.5.5-pre1 fixes
helper for safe access to parent's inumber
parent
e3a17d17
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
23 additions
and
17 deletions
+23
-17
fs/affs/dir.c
fs/affs/dir.c
+1
-1
fs/devfs/base.c
fs/devfs/base.c
+1
-1
fs/fat/dir.c
fs/fat/dir.c
+1
-1
fs/isofs/dir.c
fs/isofs/dir.c
+1
-1
fs/jffs2/dir.c
fs/jffs2/dir.c
+2
-2
fs/ncpfs/dir.c
fs/ncpfs/dir.c
+1
-2
fs/nfsd/nfsfh.c
fs/nfsd/nfsfh.c
+2
-2
fs/ntfs/fs.c
fs/ntfs/fs.c
+2
-3
fs/proc/generic.c
fs/proc/generic.c
+1
-1
fs/readdir.c
fs/readdir.c
+1
-1
fs/smbfs/dir.c
fs/smbfs/dir.c
+1
-2
include/linux/fs.h
include/linux/fs.h
+9
-0
No files found.
fs/affs/dir.c
View file @
9e87dd22
...
@@ -79,7 +79,7 @@ affs_readdir(struct file *filp, void *dirent, filldir_t filldir)
...
@@ -79,7 +79,7 @@ affs_readdir(struct file *filp, void *dirent, filldir_t filldir)
stored
++
;
stored
++
;
}
}
if
(
f_pos
==
1
)
{
if
(
f_pos
==
1
)
{
if
(
filldir
(
dirent
,
".."
,
2
,
f_pos
,
filp
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
,
DT_DIR
)
<
0
)
if
(
filldir
(
dirent
,
".."
,
2
,
f_pos
,
parent_ino
(
filp
->
f_dentry
)
,
DT_DIR
)
<
0
)
return
stored
;
return
stored
;
filp
->
f_pos
=
f_pos
=
2
;
filp
->
f_pos
=
f_pos
=
2
;
stored
++
;
stored
++
;
...
...
fs/devfs/base.c
View file @
9e87dd22
...
@@ -2678,7 +2678,7 @@ static int devfs_readdir (struct file *file, void *dirent, filldir_t filldir)
...
@@ -2678,7 +2678,7 @@ static int devfs_readdir (struct file *file, void *dirent, filldir_t filldir)
case
0
:
case
0
:
scan_dir_for_removable
(
parent
);
scan_dir_for_removable
(
parent
);
err
=
(
*
filldir
)
(
dirent
,
".."
,
2
,
file
->
f_pos
,
err
=
(
*
filldir
)
(
dirent
,
".."
,
2
,
file
->
f_pos
,
file
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
,
DT_DIR
);
parent_ino
(
file
->
f_dentry
)
,
DT_DIR
);
if
(
err
==
-
EINVAL
)
break
;
if
(
err
==
-
EINVAL
)
break
;
if
(
err
<
0
)
return
err
;
if
(
err
<
0
)
return
err
;
file
->
f_pos
++
;
file
->
f_pos
++
;
...
...
fs/fat/dir.c
View file @
9e87dd22
...
@@ -531,7 +531,7 @@ static int fat_readdirx(struct inode *inode, struct file *filp, void *dirent,
...
@@ -531,7 +531,7 @@ static int fat_readdirx(struct inode *inode, struct file *filp, void *dirent,
if
(
!
memcmp
(
de
->
name
,
MSDOS_DOT
,
11
))
if
(
!
memcmp
(
de
->
name
,
MSDOS_DOT
,
11
))
inum
=
inode
->
i_ino
;
inum
=
inode
->
i_ino
;
else
if
(
!
memcmp
(
de
->
name
,
MSDOS_DOTDOT
,
11
))
{
else
if
(
!
memcmp
(
de
->
name
,
MSDOS_DOTDOT
,
11
))
{
inum
=
filp
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
;
inum
=
parent_ino
(
filp
->
f_dentry
)
;
}
else
{
}
else
{
struct
inode
*
tmp
=
fat_iget
(
sb
,
ino
);
struct
inode
*
tmp
=
fat_iget
(
sb
,
ino
);
if
(
tmp
)
{
if
(
tmp
)
{
...
...
fs/isofs/dir.c
View file @
9e87dd22
...
@@ -185,7 +185,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -185,7 +185,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
/* Handle the case of the '..' directory */
/* Handle the case of the '..' directory */
if
(
de
->
name_len
[
0
]
==
1
&&
de
->
name
[
0
]
==
1
)
{
if
(
de
->
name_len
[
0
]
==
1
&&
de
->
name
[
0
]
==
1
)
{
inode_number
=
filp
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
;
inode_number
=
parent_ino
(
filp
->
f_dentry
)
;
if
(
filldir
(
dirent
,
".."
,
2
,
filp
->
f_pos
,
inode_number
,
DT_DIR
)
<
0
)
if
(
filldir
(
dirent
,
".."
,
2
,
filp
->
f_pos
,
inode_number
,
DT_DIR
)
<
0
)
break
;
break
;
filp
->
f_pos
+=
de_len
;
filp
->
f_pos
+=
de_len
;
...
...
fs/jffs2/dir.c
View file @
9e87dd22
...
@@ -157,8 +157,8 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir)
...
@@ -157,8 +157,8 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir)
offset
++
;
offset
++
;
}
}
if
(
offset
==
1
)
{
if
(
offset
==
1
)
{
D1
(
printk
(
KERN_DEBUG
"Dirent 1:
\"
..
\"
, ino #%lu
\n
"
,
filp
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
));
D1
(
printk
(
KERN_DEBUG
"Dirent 1:
\"
..
\"
, ino #%lu
\n
"
,
parent_ino
(
filp
->
f_dentry
)
));
if
(
filldir
(
dirent
,
".."
,
2
,
1
,
filp
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
,
DT_DIR
)
<
0
)
if
(
filldir
(
dirent
,
".."
,
2
,
1
,
parent_ino
(
filp
->
f_dentry
)
,
DT_DIR
)
<
0
)
goto
out
;
goto
out
;
offset
++
;
offset
++
;
}
}
...
...
fs/ncpfs/dir.c
View file @
9e87dd22
...
@@ -411,8 +411,7 @@ static int ncp_readdir(struct file *filp, void *dirent, filldir_t filldir)
...
@@ -411,8 +411,7 @@ static int ncp_readdir(struct file *filp, void *dirent, filldir_t filldir)
filp
->
f_pos
=
1
;
filp
->
f_pos
=
1
;
}
}
if
(
filp
->
f_pos
==
1
)
{
if
(
filp
->
f_pos
==
1
)
{
if
(
filldir
(
dirent
,
".."
,
2
,
1
,
if
(
filldir
(
dirent
,
".."
,
2
,
1
,
parent_ino
(
dentry
),
DT_DIR
))
dentry
->
d_parent
->
d_inode
->
i_ino
,
DT_DIR
))
goto
out
;
goto
out
;
filp
->
f_pos
=
2
;
filp
->
f_pos
=
2
;
}
}
...
...
fs/nfsd/nfsfh.c
View file @
9e87dd22
...
@@ -754,7 +754,7 @@ inline int _fh_update(struct dentry *dentry, struct svc_export *exp,
...
@@ -754,7 +754,7 @@ inline int _fh_update(struct dentry *dentry, struct svc_export *exp,
*
maxsize
=
2
;
*
maxsize
=
2
;
return
1
;
return
1
;
}
}
*
datap
++
=
ino_t_to_u32
(
dentry
->
d_parent
->
d_inode
->
i_ino
);
*
datap
++
=
ino_t_to_u32
(
parent_ino
(
dentry
)
);
*
maxsize
=
3
;
*
maxsize
=
3
;
return
2
;
return
2
;
}
}
...
@@ -814,7 +814,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st
...
@@ -814,7 +814,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st
fhp
->
fh_handle
.
ofh_dev
=
htonl
((
major
(
exp
->
ex_dev
)
<<
16
)
|
minor
(
exp
->
ex_dev
));
fhp
->
fh_handle
.
ofh_dev
=
htonl
((
major
(
exp
->
ex_dev
)
<<
16
)
|
minor
(
exp
->
ex_dev
));
fhp
->
fh_handle
.
ofh_xdev
=
fhp
->
fh_handle
.
ofh_dev
;
fhp
->
fh_handle
.
ofh_xdev
=
fhp
->
fh_handle
.
ofh_dev
;
fhp
->
fh_handle
.
ofh_xino
=
ino_t_to_u32
(
exp
->
ex_ino
);
fhp
->
fh_handle
.
ofh_xino
=
ino_t_to_u32
(
exp
->
ex_ino
);
fhp
->
fh_handle
.
ofh_dirino
=
ino_t_to_u32
(
dentry
->
d_parent
->
d_inode
->
i_ino
);
fhp
->
fh_handle
.
ofh_dirino
=
ino_t_to_u32
(
parent_ino
(
dentry
)
);
if
(
inode
)
if
(
inode
)
_fh_update_old
(
dentry
,
exp
,
&
fhp
->
fh_handle
);
_fh_update_old
(
dentry
,
exp
,
&
fhp
->
fh_handle
);
}
else
{
}
else
{
...
...
fs/ntfs/fs.c
View file @
9e87dd22
...
@@ -276,10 +276,9 @@ static int ntfs_readdir(struct file* filp, void *dirent, filldir_t filldir)
...
@@ -276,10 +276,9 @@ static int ntfs_readdir(struct file* filp, void *dirent, filldir_t filldir)
ntfs_debug
(
DEBUG_OTHER
,
__FUNCTION__
"(): Calling "
ntfs_debug
(
DEBUG_OTHER
,
__FUNCTION__
"(): Calling "
"filldir for .. with len 2, f_pos 0x%Lx, "
"filldir for .. with len 2, f_pos 0x%Lx, "
"inode %lu, DT_DIR.
\n
"
,
filp
->
f_pos
,
"inode %lu, DT_DIR.
\n
"
,
filp
->
f_pos
,
filp
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
);
parent_ino
(
filp
->
f_dentry
)
);
cb
.
ret_code
=
filldir
(
dirent
,
".."
,
2
,
filp
->
f_pos
,
cb
.
ret_code
=
filldir
(
dirent
,
".."
,
2
,
filp
->
f_pos
,
filp
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
,
parent_ino
(
filp
->
f_dentry
),
DT_DIR
);
DT_DIR
);
if
(
cb
.
ret_code
)
if
(
cb
.
ret_code
)
goto
done
;
goto
done
;
cb
.
pl
++
;
cb
.
pl
++
;
...
...
fs/proc/generic.c
View file @
9e87dd22
...
@@ -319,7 +319,7 @@ int proc_readdir(struct file * filp,
...
@@ -319,7 +319,7 @@ int proc_readdir(struct file * filp,
/* fall through */
/* fall through */
case
1
:
case
1
:
if
(
filldir
(
dirent
,
".."
,
2
,
i
,
if
(
filldir
(
dirent
,
".."
,
2
,
i
,
filp
->
f_dentry
->
d_parent
->
d_inode
->
i_ino
,
parent_ino
(
filp
->
f_dentry
)
,
DT_DIR
)
<
0
)
DT_DIR
)
<
0
)
return
0
;
return
0
;
i
++
;
i
++
;
...
...
fs/readdir.c
View file @
9e87dd22
...
@@ -52,7 +52,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
...
@@ -52,7 +52,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
filp
->
f_pos
++
;
filp
->
f_pos
++
;
/* fallthrough */
/* fallthrough */
case
1
:
case
1
:
if
(
filldir
(
dirent
,
".."
,
2
,
i
,
dentry
->
d_parent
->
d_inode
->
i_ino
,
DT_DIR
)
<
0
)
if
(
filldir
(
dirent
,
".."
,
2
,
i
,
parent_ino
(
dentry
)
,
DT_DIR
)
<
0
)
break
;
break
;
i
++
;
i
++
;
filp
->
f_pos
++
;
filp
->
f_pos
++
;
...
...
fs/smbfs/dir.c
View file @
9e87dd22
...
@@ -82,8 +82,7 @@ smb_readdir(struct file *filp, void *dirent, filldir_t filldir)
...
@@ -82,8 +82,7 @@ smb_readdir(struct file *filp, void *dirent, filldir_t filldir)
filp
->
f_pos
=
1
;
filp
->
f_pos
=
1
;
/* fallthrough */
/* fallthrough */
case
1
:
case
1
:
if
(
filldir
(
dirent
,
".."
,
2
,
1
,
if
(
filldir
(
dirent
,
".."
,
2
,
1
,
parent_ino
(
dentry
),
DT_DIR
)
<
0
)
dentry
->
d_parent
->
d_inode
->
i_ino
,
DT_DIR
)
<
0
)
goto
out
;
goto
out
;
filp
->
f_pos
=
2
;
filp
->
f_pos
=
2
;
}
}
...
...
include/linux/fs.h
View file @
9e87dd22
...
@@ -1508,6 +1508,15 @@ extern int generic_osync_inode(struct inode *, int);
...
@@ -1508,6 +1508,15 @@ extern int generic_osync_inode(struct inode *, int);
extern
int
inode_change_ok
(
struct
inode
*
,
struct
iattr
*
);
extern
int
inode_change_ok
(
struct
inode
*
,
struct
iattr
*
);
extern
int
inode_setattr
(
struct
inode
*
,
struct
iattr
*
);
extern
int
inode_setattr
(
struct
inode
*
,
struct
iattr
*
);
static
inline
ino_t
parent_ino
(
struct
dentry
*
dentry
)
{
ino_t
res
;
spin_lock
(
&
dcache_lock
);
res
=
dentry
->
d_parent
->
d_inode
->
i_ino
;
spin_unlock
(
&
dcache_lock
);
return
res
;
}
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
#endif
/* _LINUX_FS_H */
#endif
/* _LINUX_FS_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment