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
f118d8b9
Commit
f118d8b9
authored
Oct 15, 2002
by
Eric Sandeen
Committed by
Christoph Hellwig
Oct 15, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XFS: Allow quota inode creation on a read-only filesystem.
Modid: 2.5.x-xfs:slinx:128905a
parent
c76586cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
11 deletions
+32
-11
fs/xfs/linux/xfs_lrw.c
fs/xfs/linux/xfs_lrw.c
+9
-0
fs/xfs/linux/xfs_lrw.h
fs/xfs/linux/xfs_lrw.h
+1
-0
fs/xfs/xfs_qm.c
fs/xfs/xfs_qm.c
+22
-11
No files found.
fs/xfs/linux/xfs_lrw.c
View file @
f118d8b9
...
...
@@ -1863,3 +1863,12 @@ xfs_quotacheck_read_only(xfs_mount_t *mp)
"quotacheck required on readonly filesystem."
);
return
xfs_is_read_only
(
mp
);
}
int
xfs_quotaino_create_read_only
(
xfs_mount_t
*
mp
)
{
cmn_err
(
CE_NOTE
,
"XFS: WARNING: "
"Quota inode creation required on readonly filesystem."
);
return
xfs_is_read_only
(
mp
);
}
fs/xfs/linux/xfs_lrw.h
View file @
f118d8b9
...
...
@@ -64,6 +64,7 @@ extern ssize_t xfs_write (
extern
int
xfs_recover_read_only
(
xlog_t
*
);
extern
int
xfs_quotacheck_read_only
(
xfs_mount_t
*
);
extern
int
xfs_quotaino_create_read_only
(
xfs_mount_t
*
);
extern
void
XFS_log_write_unmount_ro
(
bhv_desc_t
*
);
...
...
fs/xfs/xfs_qm.c
View file @
f118d8b9
...
...
@@ -1998,11 +1998,16 @@ xfs_qm_init_quotainos(
int
error
;
__int64_t
sbflags
;
uint
flags
;
int
readonly
;
vfs_t
*
vfsp
;
ASSERT
(
mp
->
m_quotainfo
);
uip
=
gip
=
NULL
;
error
=
0
;
sbflags
=
0
;
flags
=
0
;
vfsp
=
XFS_MTOVFS
(
mp
);
readonly
=
vfsp
->
vfs_flag
&
VFS_RDONLY
;
/*
* Get the uquota and gquota inodes
...
...
@@ -2034,38 +2039,44 @@ xfs_qm_init_quotainos(
/*
* Create the two inodes, if they don't exist already. The changes
* made above will get added to a transaction and logged in one of
* the qino_alloc calls below.
* the qino_alloc calls below. If the device is readonly,
* temporarily switch to read-write to do this.
*/
if
(
readonly
&&
((
XFS_IS_UQUOTA_ON
(
mp
)
&&
uip
==
NULL
)
||
(
XFS_IS_GQUOTA_ON
(
mp
)
&&
gip
==
NULL
)))
{
if
((
error
=
xfs_quotaino_create_read_only
(
mp
)))
goto
error
;
}
if
(
XFS_IS_UQUOTA_ON
(
mp
)
&&
uip
==
NULL
)
{
if
(
XFS_MTOVFS
(
mp
)
->
vfs_flag
&
VFS_RDONLY
)
return
XFS_ERROR
(
EROFS
);
if
((
error
=
xfs_qm_qino_alloc
(
mp
,
&
uip
,
sbflags
|
XFS_SB_UQUOTINO
,
flags
|
XFS_QMOPT_UQUOTA
)))
return
XFS_ERROR
(
error
)
;
goto
error
;
flags
&=
~
XFS_QMOPT_SBVERSION
;
}
if
(
XFS_IS_GQUOTA_ON
(
mp
)
&&
gip
==
NULL
)
{
if
(
XFS_MTOVFS
(
mp
)
->
vfs_flag
&
VFS_RDONLY
)
{
if
(
uip
)
VN_RELE
(
XFS_ITOV
(
uip
));
return
XFS_ERROR
(
EROFS
);
}
if
((
error
=
xfs_qm_qino_alloc
(
mp
,
&
gip
,
sbflags
|
XFS_SB_GQUOTINO
,
flags
|
XFS_QMOPT_GQUOTA
)))
{
if
(
uip
)
VN_RELE
(
XFS_ITOV
(
uip
));
return
XFS_ERROR
(
error
)
;
goto
error
;
}
}
XFS_QI_UQIP
(
mp
)
=
uip
;
XFS_QI_GQIP
(
mp
)
=
gip
;
return
(
0
);
error:
if
(
readonly
)
vfsp
->
vfs_flag
|=
VFS_RDONLY
;
return
XFS_ERROR
(
error
);
}
...
...
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