Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233816
b: refs/heads/master
c: 810c1b2
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 3, 2011
1 parent 1a8da4f commit 94c2ac7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 99890a3be1ee67346300f1e0a873006588760f2a
refs/heads/master: 810c1b2e48d32a8605928c3609262d94853c3a76
11 changes: 5 additions & 6 deletions trunk/fs/udf/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <linux/crc-itu-t.h>
#include <linux/exportfs.h>

enum { UDF_MAX_LINKS = 0xffff };

static inline int udf_match(int len1, const unsigned char *name1, int len2,
const unsigned char *name2)
{
Expand Down Expand Up @@ -650,7 +652,7 @@ static int udf_mkdir(struct inode *dir, struct dentry *dentry, int mode)
struct udf_inode_info *iinfo;

err = -EMLINK;
if (dir->i_nlink >= (256 << sizeof(dir->i_nlink)) - 1)
if (dir->i_nlink >= UDF_MAX_LINKS)
goto out;

err = -EIO;
Expand Down Expand Up @@ -1034,9 +1036,8 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir,
struct fileIdentDesc cfi, *fi;
int err;

if (inode->i_nlink >= (256 << sizeof(inode->i_nlink)) - 1) {
if (inode->i_nlink >= UDF_MAX_LINKS)
return -EMLINK;
}

fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
if (!fi) {
Expand Down Expand Up @@ -1131,9 +1132,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
goto end_rename;

retval = -EMLINK;
if (!new_inode &&
new_dir->i_nlink >=
(256 << sizeof(new_dir->i_nlink)) - 1)
if (!new_inode && new_dir->i_nlink >= UDF_MAX_LINKS)
goto end_rename;
}
if (!nfi) {
Expand Down

0 comments on commit 94c2ac7

Please sign in to comment.