diff options
author | Joel Becker <jlbec@evilplan.org> | 2011-03-28 09:44:26 -0700 |
---|---|---|
committer | Joel Becker <jlbec@evilplan.org> | 2011-03-28 09:44:26 -0700 |
commit | 99bdc3880c611c7f2061fbd5372ef81b40217e26 (patch) | |
tree | ef68a53e28e9ee53ce9db3642bab5fa5b3d44866 /fs/udf | |
parent | ed59992e8d91b70053c53d846a76f7e1ac000454 (diff) | |
parent | b4e1b7e88b2c87c358c2a88bec0c76d25accc604 (diff) | |
download | blackbird-op-linux-99bdc3880c611c7f2061fbd5372ef81b40217e26.tar.gz blackbird-op-linux-99bdc3880c611c7f2061fbd5372ef81b40217e26.zip |
Merge branch 'mlog_replace_for_39' of git://repo.or.cz/taoma-kernel into ocfs2-merge-window-fix
Diffstat (limited to 'fs/udf')
-rw-r--r-- | fs/udf/namei.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 2be0f9eb86d2..f1dce848ef96 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -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) { @@ -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; @@ -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) { @@ -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) { @@ -1287,8 +1286,13 @@ static int udf_encode_fh(struct dentry *de, __u32 *fh, int *lenp, struct fid *fid = (struct fid *)fh; int type = FILEID_UDF_WITHOUT_PARENT; - if (len < 3 || (connectable && len < 5)) + if (connectable && (len < 5)) { + *lenp = 5; return 255; + } else if (len < 3) { + *lenp = 3; + return 255; + } *lenp = 3; fid->udf.block = location.logicalBlockNum; |