* [PATCH] ext4: Limit number of links that can be created by ext4_link()
@ 2009-08-29 1:53 Theodore Ts'o
0 siblings, 0 replies; only message in thread
From: Theodore Ts'o @ 2009-08-29 1:53 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Theodore Ts'o
In ext4_link we need to check using EXT4_LINK_MAX, and not
EXT4_DIR_LINK_MAX(), since ext4_link() is creating hard links of
regular files, and not directories.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
fs/ext4/namei.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 3692ba6..f92cc06 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2318,7 +2318,7 @@ static int ext4_link(struct dentry *old_dentry,
struct inode *inode = old_dentry->d_inode;
int err, retries = 0;
- if (EXT4_DIR_LINK_MAX(inode))
+ if (inode->i_nlink >= EXT4_LINK_MAX)
return -EMLINK;
/*
--
1.6.3.2.1.gb9f7d.dirty
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-29 1:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-29 1:53 [PATCH] ext4: Limit number of links that can be created by ext4_link() Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).