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
9a747377
Commit
9a747377
authored
Feb 02, 2003
by
Andrew Morton
Committed by
Linus Torvalds
Feb 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] quota locking fix
Quota locking fix from Jan Kara.
parent
5a3446d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
fs/dquot.c
fs/dquot.c
+7
-4
No files found.
fs/dquot.c
View file @
9a747377
...
@@ -1157,6 +1157,7 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path)
...
@@ -1157,6 +1157,7 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path)
struct
quota_info
*
dqopt
=
sb_dqopt
(
sb
);
struct
quota_info
*
dqopt
=
sb_dqopt
(
sb
);
struct
quota_format_type
*
fmt
=
find_quota_format
(
format_id
);
struct
quota_format_type
*
fmt
=
find_quota_format
(
format_id
);
int
error
;
int
error
;
unsigned
int
oldflags
;
if
(
!
fmt
)
if
(
!
fmt
)
return
-
ESRCH
;
return
-
ESRCH
;
...
@@ -1181,10 +1182,11 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path)
...
@@ -1181,10 +1182,11 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path)
error
=
-
EBUSY
;
error
=
-
EBUSY
;
goto
out_lock
;
goto
out_lock
;
}
}
oldflags
=
inode
->
i_flags
;
dqopt
->
files
[
type
]
=
f
;
dqopt
->
files
[
type
]
=
f
;
error
=
-
EINVAL
;
error
=
-
EINVAL
;
if
(
!
fmt
->
qf_ops
->
check_quota_file
(
sb
,
type
))
if
(
!
fmt
->
qf_ops
->
check_quota_file
(
sb
,
type
))
goto
out_
lock
;
goto
out_
file_init
;
/* We don't want quota on quota files */
/* We don't want quota on quota files */
dquot_drop_nolock
(
inode
);
dquot_drop_nolock
(
inode
);
inode
->
i_flags
|=
S_NOQUOTA
;
inode
->
i_flags
|=
S_NOQUOTA
;
...
@@ -1194,7 +1196,7 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path)
...
@@ -1194,7 +1196,7 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path)
down
(
&
dqopt
->
dqio_sem
);
down
(
&
dqopt
->
dqio_sem
);
if
((
error
=
dqopt
->
ops
[
type
]
->
read_file_info
(
sb
,
type
))
<
0
)
{
if
((
error
=
dqopt
->
ops
[
type
]
->
read_file_info
(
sb
,
type
))
<
0
)
{
up
(
&
dqopt
->
dqio_sem
);
up
(
&
dqopt
->
dqio_sem
);
goto
out_
lock
;
goto
out_
file_init
;
}
}
up
(
&
dqopt
->
dqio_sem
);
up
(
&
dqopt
->
dqio_sem
);
set_enable_flags
(
dqopt
,
type
);
set_enable_flags
(
dqopt
,
type
);
...
@@ -1204,9 +1206,10 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path)
...
@@ -1204,9 +1206,10 @@ int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path)
up_write
(
&
dqopt
->
dqoff_sem
);
up_write
(
&
dqopt
->
dqoff_sem
);
return
0
;
return
0
;
out_
lock
:
out_
file_init
:
inode
->
i_flags
&=
~
S_NOQUOTA
;
inode
->
i_flags
=
oldflags
;
dqopt
->
files
[
type
]
=
NULL
;
dqopt
->
files
[
type
]
=
NULL
;
out_lock:
up_write
(
&
dqopt
->
dqoff_sem
);
up_write
(
&
dqopt
->
dqoff_sem
);
out_f:
out_f:
filp_close
(
f
,
NULL
);
filp_close
(
f
,
NULL
);
...
...
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