lkml.org 
[lkml]   [2009]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[14/90] ext4: Limit number of links that can be created by ext4_link()
    2.6.31-stable review patch.  If anyone has any objections, please let us know.

    ------------------
    (cherry picked from commit b05ab1dc3795e6f997fb0d34f38fce5012533c3e)

    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 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/ext4/namei.c
    +++ b/fs/ext4/namei.c
    @@ -2310,7 +2310,7 @@ static int ext4_link(struct dentry *old_
    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;

    /*



    \
     
     \ /
      Last update: 2009-12-11 05:41    [W:0.022 / U:8.572 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site