diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-02-06 12:45:27 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:32 -0400 |
commit | 8de52778798fe39660a8d6b26f290e0c93202761 (patch) | |
tree | 56384beb7863c1f338f2b66b509bf58eea5a99c2 /fs/udf/super.c | |
parent | c16fa4f2ad19908a47c63d8fa436a1178438c7e7 (diff) |
vfs: check i_nlink limits in vfs_{mkdir,rename_dir,link}
New field of struct super_block - ->s_max_links. Maximal allowed
value of ->i_nlink or 0; in the latter case all checks still need
to be done in ->link/->mkdir/->rename instances. Note that this
limit applies both to directoris and to non-directories.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index c09a84daaf50..8d8b25336fbb 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -75,6 +75,8 @@ | |||
75 | 75 | ||
76 | #define UDF_DEFAULT_BLOCKSIZE 2048 | 76 | #define UDF_DEFAULT_BLOCKSIZE 2048 |
77 | 77 | ||
78 | enum { UDF_MAX_LINKS = 0xffff }; | ||
79 | |||
78 | /* These are the "meat" - everything else is stuffing */ | 80 | /* These are the "meat" - everything else is stuffing */ |
79 | static int udf_fill_super(struct super_block *, void *, int); | 81 | static int udf_fill_super(struct super_block *, void *, int); |
80 | static void udf_put_super(struct super_block *); | 82 | static void udf_put_super(struct super_block *); |
@@ -2042,6 +2044,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
2042 | goto error_out; | 2044 | goto error_out; |
2043 | } | 2045 | } |
2044 | sb->s_maxbytes = MAX_LFS_FILESIZE; | 2046 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
2047 | sb->s_max_links = UDF_MAX_LINKS; | ||
2045 | return 0; | 2048 | return 0; |
2046 | 2049 | ||
2047 | error_out: | 2050 | error_out: |