diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/9p/conv.c | 6 | ||||
| -rw-r--r-- | fs/9p/vfs_inode.c | 6 | ||||
| -rw-r--r-- | fs/buffer.c | 7 | ||||
| -rw-r--r-- | fs/coda/file.c | 4 | ||||
| -rw-r--r-- | fs/efs/symlink.c | 3 | ||||
| -rw-r--r-- | fs/ext3/inode.c | 19 | ||||
| -rw-r--r-- | fs/ext3/namei.c | 15 | ||||
| -rw-r--r-- | fs/freevxfs/vxfs_lookup.c | 2 | ||||
| -rw-r--r-- | fs/fuse/control.c | 4 | ||||
| -rw-r--r-- | fs/fuse/dir.c | 47 | ||||
| -rw-r--r-- | fs/fuse/fuse_i.h | 2 | ||||
| -rw-r--r-- | fs/fuse/inode.c | 2 | ||||
| -rw-r--r-- | fs/inotify_user.c | 2 | ||||
| -rw-r--r-- | fs/nfsd/nfsfh.c | 20 | ||||
| -rw-r--r-- | fs/partitions/Kconfig | 2 | ||||
| -rw-r--r-- | fs/ufs/namei.c | 3 | ||||
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.h | 4 | ||||
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 7 | ||||
| -rw-r--r-- | fs/xfs/quota/xfs_qm_bhv.c | 19 | ||||
| -rw-r--r-- | fs/xfs/xfs_inode.c | 17 | ||||
| -rw-r--r-- | fs/xfs/xfs_log.c | 12 | ||||
| -rw-r--r-- | fs/xfs/xfs_vfsops.c | 2 |
22 files changed, 140 insertions, 65 deletions
diff --git a/fs/9p/conv.c b/fs/9p/conv.c index 1e898144eb7c..56d88c1a09c5 100644 --- a/fs/9p/conv.c +++ b/fs/9p/conv.c | |||
| @@ -673,8 +673,10 @@ struct v9fs_fcall *v9fs_create_tcreate(u32 fid, char *name, u32 perm, u8 mode, | |||
| 673 | struct cbuf *bufp = &buffer; | 673 | struct cbuf *bufp = &buffer; |
| 674 | 674 | ||
| 675 | size = 4 + 2 + strlen(name) + 4 + 1; /* fid[4] name[s] perm[4] mode[1] */ | 675 | size = 4 + 2 + strlen(name) + 4 + 1; /* fid[4] name[s] perm[4] mode[1] */ |
| 676 | if (extended && extension!=NULL) | 676 | if (extended) { |
| 677 | size += 2 + strlen(extension); /* extension[s] */ | 677 | size += 2 + /* extension[s] */ |
| 678 | (extension == NULL ? 0 : strlen(extension)); | ||
| 679 | } | ||
| 678 | 680 | ||
| 679 | fc = v9fs_create_common(bufp, size, TCREATE); | 681 | fc = v9fs_create_common(bufp, size, TCREATE); |
| 680 | if (IS_ERR(fc)) | 682 | if (IS_ERR(fc)) |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 2f580a197b8d..eae50c9d6dc4 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
| @@ -434,11 +434,11 @@ static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir) | |||
| 434 | result = v9fs_t_remove(v9ses, fid, &fcall); | 434 | result = v9fs_t_remove(v9ses, fid, &fcall); |
| 435 | if (result < 0) { | 435 | if (result < 0) { |
| 436 | PRINT_FCALL_ERROR("remove fails", fcall); | 436 | PRINT_FCALL_ERROR("remove fails", fcall); |
| 437 | } else { | ||
| 438 | v9fs_put_idpool(fid, &v9ses->fidpool); | ||
| 439 | v9fs_fid_destroy(v9fid); | ||
| 440 | } | 437 | } |
| 441 | 438 | ||
| 439 | v9fs_put_idpool(fid, &v9ses->fidpool); | ||
| 440 | v9fs_fid_destroy(v9fid); | ||
| 441 | |||
| 442 | kfree(fcall); | 442 | kfree(fcall); |
| 443 | return result; | 443 | return result; |
| 444 | } | 444 | } |
diff --git a/fs/buffer.c b/fs/buffer.c index 3660dcb97591..71649ef9b658 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
| @@ -470,13 +470,18 @@ out: | |||
| 470 | pass does the actual I/O. */ | 470 | pass does the actual I/O. */ |
| 471 | void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) | 471 | void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) |
| 472 | { | 472 | { |
| 473 | struct address_space *mapping = bdev->bd_inode->i_mapping; | ||
| 474 | |||
| 475 | if (mapping->nrpages == 0) | ||
| 476 | return; | ||
| 477 | |||
| 473 | invalidate_bh_lrus(); | 478 | invalidate_bh_lrus(); |
| 474 | /* | 479 | /* |
| 475 | * FIXME: what about destroy_dirty_buffers? | 480 | * FIXME: what about destroy_dirty_buffers? |
| 476 | * We really want to use invalidate_inode_pages2() for | 481 | * We really want to use invalidate_inode_pages2() for |
| 477 | * that, but not until that's cleaned up. | 482 | * that, but not until that's cleaned up. |
| 478 | */ | 483 | */ |
| 479 | invalidate_inode_pages(bdev->bd_inode->i_mapping); | 484 | invalidate_inode_pages(mapping); |
| 480 | } | 485 | } |
| 481 | 486 | ||
| 482 | /* | 487 | /* |
diff --git a/fs/coda/file.c b/fs/coda/file.c index cc66c681bd11..dbfbcfa5b3c0 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c | |||
| @@ -136,10 +136,8 @@ int coda_open(struct inode *coda_inode, struct file *coda_file) | |||
| 136 | coda_vfs_stat.open++; | 136 | coda_vfs_stat.open++; |
| 137 | 137 | ||
| 138 | cfi = kmalloc(sizeof(struct coda_file_info), GFP_KERNEL); | 138 | cfi = kmalloc(sizeof(struct coda_file_info), GFP_KERNEL); |
| 139 | if (!cfi) { | 139 | if (!cfi) |
| 140 | unlock_kernel(); | ||
| 141 | return -ENOMEM; | 140 | return -ENOMEM; |
| 142 | } | ||
| 143 | 141 | ||
| 144 | lock_kernel(); | 142 | lock_kernel(); |
| 145 | 143 | ||
diff --git a/fs/efs/symlink.c b/fs/efs/symlink.c index e249cf733a6b..1d30d2ff440f 100644 --- a/fs/efs/symlink.c +++ b/fs/efs/symlink.c | |||
| @@ -22,7 +22,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page) | |||
| 22 | 22 | ||
| 23 | err = -ENAMETOOLONG; | 23 | err = -ENAMETOOLONG; |
| 24 | if (size > 2 * EFS_BLOCKSIZE) | 24 | if (size > 2 * EFS_BLOCKSIZE) |
| 25 | goto fail; | 25 | goto fail_notlocked; |
| 26 | 26 | ||
| 27 | lock_kernel(); | 27 | lock_kernel(); |
| 28 | /* read first 512 bytes of link target */ | 28 | /* read first 512 bytes of link target */ |
| @@ -47,6 +47,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page) | |||
| 47 | return 0; | 47 | return 0; |
| 48 | fail: | 48 | fail: |
| 49 | unlock_kernel(); | 49 | unlock_kernel(); |
| 50 | fail_notlocked: | ||
| 50 | SetPageError(page); | 51 | SetPageError(page); |
| 51 | kunmap(page); | 52 | kunmap(page); |
| 52 | unlock_page(page); | 53 | unlock_page(page); |
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index f804d5e9d60c..c5ee9f0691e3 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
| @@ -1158,7 +1158,7 @@ retry: | |||
| 1158 | ret = PTR_ERR(handle); | 1158 | ret = PTR_ERR(handle); |
| 1159 | goto out; | 1159 | goto out; |
| 1160 | } | 1160 | } |
| 1161 | if (test_opt(inode->i_sb, NOBH)) | 1161 | if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode)) |
| 1162 | ret = nobh_prepare_write(page, from, to, ext3_get_block); | 1162 | ret = nobh_prepare_write(page, from, to, ext3_get_block); |
| 1163 | else | 1163 | else |
| 1164 | ret = block_prepare_write(page, from, to, ext3_get_block); | 1164 | ret = block_prepare_write(page, from, to, ext3_get_block); |
| @@ -1244,7 +1244,7 @@ static int ext3_writeback_commit_write(struct file *file, struct page *page, | |||
| 1244 | if (new_i_size > EXT3_I(inode)->i_disksize) | 1244 | if (new_i_size > EXT3_I(inode)->i_disksize) |
| 1245 | EXT3_I(inode)->i_disksize = new_i_size; | 1245 | EXT3_I(inode)->i_disksize = new_i_size; |
| 1246 | 1246 | ||
| 1247 | if (test_opt(inode->i_sb, NOBH)) | 1247 | if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode)) |
| 1248 | ret = nobh_commit_write(file, page, from, to); | 1248 | ret = nobh_commit_write(file, page, from, to); |
| 1249 | else | 1249 | else |
| 1250 | ret = generic_commit_write(file, page, from, to); | 1250 | ret = generic_commit_write(file, page, from, to); |
| @@ -1494,7 +1494,7 @@ static int ext3_writeback_writepage(struct page *page, | |||
| 1494 | goto out_fail; | 1494 | goto out_fail; |
| 1495 | } | 1495 | } |
| 1496 | 1496 | ||
| 1497 | if (test_opt(inode->i_sb, NOBH)) | 1497 | if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode)) |
| 1498 | ret = nobh_writepage(page, ext3_get_block, wbc); | 1498 | ret = nobh_writepage(page, ext3_get_block, wbc); |
| 1499 | else | 1499 | else |
| 1500 | ret = block_write_full_page(page, ext3_get_block, wbc); | 1500 | ret = block_write_full_page(page, ext3_get_block, wbc); |
| @@ -2402,14 +2402,15 @@ static ext3_fsblk_t ext3_get_inode_block(struct super_block *sb, | |||
| 2402 | struct buffer_head *bh; | 2402 | struct buffer_head *bh; |
| 2403 | struct ext3_group_desc * gdp; | 2403 | struct ext3_group_desc * gdp; |
| 2404 | 2404 | ||
| 2405 | 2405 | if (!ext3_valid_inum(sb, ino)) { | |
| 2406 | if ((ino != EXT3_ROOT_INO && ino != EXT3_JOURNAL_INO && | 2406 | /* |
| 2407 | ino != EXT3_RESIZE_INO && ino < EXT3_FIRST_INO(sb)) || | 2407 | * This error is already checked for in namei.c unless we are |
| 2408 | ino > le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count)) { | 2408 | * looking at an NFS filehandle, in which case no error |
| 2409 | ext3_error(sb, "ext3_get_inode_block", | 2409 | * report is needed |
| 2410 | "bad inode number: %lu", ino); | 2410 | */ |
| 2411 | return 0; | 2411 | return 0; |
| 2412 | } | 2412 | } |
| 2413 | |||
| 2413 | block_group = (ino - 1) / EXT3_INODES_PER_GROUP(sb); | 2414 | block_group = (ino - 1) / EXT3_INODES_PER_GROUP(sb); |
| 2414 | if (block_group >= EXT3_SB(sb)->s_groups_count) { | 2415 | if (block_group >= EXT3_SB(sb)->s_groups_count) { |
| 2415 | ext3_error(sb,"ext3_get_inode_block","group >= groups count"); | 2416 | ext3_error(sb,"ext3_get_inode_block","group >= groups count"); |
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index d9176dba3698..2aa7101b27cd 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
| @@ -1000,7 +1000,12 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str | |||
| 1000 | if (bh) { | 1000 | if (bh) { |
| 1001 | unsigned long ino = le32_to_cpu(de->inode); | 1001 | unsigned long ino = le32_to_cpu(de->inode); |
| 1002 | brelse (bh); | 1002 | brelse (bh); |
| 1003 | inode = iget(dir->i_sb, ino); | 1003 | if (!ext3_valid_inum(dir->i_sb, ino)) { |
| 1004 | ext3_error(dir->i_sb, "ext3_lookup", | ||
| 1005 | "bad inode number: %lu", ino); | ||
| 1006 | inode = NULL; | ||
| 1007 | } else | ||
| 1008 | inode = iget(dir->i_sb, ino); | ||
| 1004 | 1009 | ||
| 1005 | if (!inode) | 1010 | if (!inode) |
| 1006 | return ERR_PTR(-EACCES); | 1011 | return ERR_PTR(-EACCES); |
| @@ -1028,7 +1033,13 @@ struct dentry *ext3_get_parent(struct dentry *child) | |||
| 1028 | return ERR_PTR(-ENOENT); | 1033 | return ERR_PTR(-ENOENT); |
| 1029 | ino = le32_to_cpu(de->inode); | 1034 | ino = le32_to_cpu(de->inode); |
| 1030 | brelse(bh); | 1035 | brelse(bh); |
| 1031 | inode = iget(child->d_inode->i_sb, ino); | 1036 | |
| 1037 | if (!ext3_valid_inum(child->d_inode->i_sb, ino)) { | ||
| 1038 | ext3_error(child->d_inode->i_sb, "ext3_get_parent", | ||
| 1039 | "bad inode number: %lu", ino); | ||
| 1040 | inode = NULL; | ||
| 1041 | } else | ||
| 1042 | inode = iget(child->d_inode->i_sb, ino); | ||
| 1032 | 1043 | ||
| 1033 | if (!inode) | 1044 | if (!inode) |
| 1034 | return ERR_PTR(-EACCES); | 1045 | return ERR_PTR(-EACCES); |
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c index 29cce456c7ce..43886fa00a2a 100644 --- a/fs/freevxfs/vxfs_lookup.c +++ b/fs/freevxfs/vxfs_lookup.c | |||
| @@ -246,6 +246,8 @@ vxfs_readdir(struct file *fp, void *retp, filldir_t filler) | |||
| 246 | u_long page, npages, block, pblocks, nblocks, offset; | 246 | u_long page, npages, block, pblocks, nblocks, offset; |
| 247 | loff_t pos; | 247 | loff_t pos; |
| 248 | 248 | ||
| 249 | lock_kernel(); | ||
| 250 | |||
| 249 | switch ((long)fp->f_pos) { | 251 | switch ((long)fp->f_pos) { |
| 250 | case 0: | 252 | case 0: |
| 251 | if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0) | 253 | if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0) |
diff --git a/fs/fuse/control.c b/fs/fuse/control.c index a3bce3a77253..46fe60b2da23 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c | |||
| @@ -105,7 +105,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent, | |||
| 105 | 105 | ||
| 106 | /* | 106 | /* |
| 107 | * Add a connection to the control filesystem (if it exists). Caller | 107 | * Add a connection to the control filesystem (if it exists). Caller |
| 108 | * must host fuse_mutex | 108 | * must hold fuse_mutex |
| 109 | */ | 109 | */ |
| 110 | int fuse_ctl_add_conn(struct fuse_conn *fc) | 110 | int fuse_ctl_add_conn(struct fuse_conn *fc) |
| 111 | { | 111 | { |
| @@ -139,7 +139,7 @@ int fuse_ctl_add_conn(struct fuse_conn *fc) | |||
| 139 | 139 | ||
| 140 | /* | 140 | /* |
| 141 | * Remove a connection from the control filesystem (if it exists). | 141 | * Remove a connection from the control filesystem (if it exists). |
| 142 | * Caller must host fuse_mutex | 142 | * Caller must hold fuse_mutex |
| 143 | */ | 143 | */ |
| 144 | void fuse_ctl_remove_conn(struct fuse_conn *fc) | 144 | void fuse_ctl_remove_conn(struct fuse_conn *fc) |
| 145 | { | 145 | { |
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 72a74cde6de8..409ce6a7cca4 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
| @@ -14,6 +14,33 @@ | |||
| 14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 15 | #include <linux/namei.h> | 15 | #include <linux/namei.h> |
| 16 | 16 | ||
| 17 | #if BITS_PER_LONG >= 64 | ||
| 18 | static inline void fuse_dentry_settime(struct dentry *entry, u64 time) | ||
| 19 | { | ||
| 20 | entry->d_time = time; | ||
| 21 | } | ||
| 22 | |||
| 23 | static inline u64 fuse_dentry_time(struct dentry *entry) | ||
| 24 | { | ||
| 25 | return entry->d_time; | ||
| 26 | } | ||
| 27 | #else | ||
| 28 | /* | ||
| 29 | * On 32 bit archs store the high 32 bits of time in d_fsdata | ||
| 30 | */ | ||
| 31 | static void fuse_dentry_settime(struct dentry *entry, u64 time) | ||
| 32 | { | ||
| 33 | entry->d_time = time; | ||
| 34 | entry->d_fsdata = (void *) (unsigned long) (time >> 32); | ||
| 35 | } | ||
| 36 | |||
| 37 | static u64 fuse_dentry_time(struct dentry *entry) | ||
| 38 | { | ||
| 39 | return (u64) entry->d_time + | ||
| 40 | ((u64) (unsigned long) entry->d_fsdata << 32); | ||
| 41 | } | ||
| 42 | #endif | ||
| 43 | |||
| 17 | /* | 44 | /* |
| 18 | * FUSE caches dentries and attributes with separate timeout. The | 45 | * FUSE caches dentries and attributes with separate timeout. The |
| 19 | * time in jiffies until the dentry/attributes are valid is stored in | 46 | * time in jiffies until the dentry/attributes are valid is stored in |
| @@ -23,10 +50,13 @@ | |||
| 23 | /* | 50 | /* |
| 24 | * Calculate the time in jiffies until a dentry/attributes are valid | 51 | * Calculate the time in jiffies until a dentry/attributes are valid |
| 25 | */ | 52 | */ |
| 26 | static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec) | 53 | static u64 time_to_jiffies(unsigned long sec, unsigned long nsec) |
| 27 | { | 54 | { |
| 28 | struct timespec ts = {sec, nsec}; | 55 | if (sec || nsec) { |
| 29 | return jiffies + timespec_to_jiffies(&ts); | 56 | struct timespec ts = {sec, nsec}; |
| 57 | return get_jiffies_64() + timespec_to_jiffies(&ts); | ||
| 58 | } else | ||
| 59 | return 0; | ||
| 30 | } | 60 | } |
| 31 | 61 | ||
| 32 | /* | 62 | /* |
| @@ -35,7 +65,8 @@ static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec) | |||
| 35 | */ | 65 | */ |
| 36 | static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o) | 66 | static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o) |
| 37 | { | 67 | { |
| 38 | entry->d_time = time_to_jiffies(o->entry_valid, o->entry_valid_nsec); | 68 | fuse_dentry_settime(entry, |
| 69 | time_to_jiffies(o->entry_valid, o->entry_valid_nsec)); | ||
| 39 | if (entry->d_inode) | 70 | if (entry->d_inode) |
| 40 | get_fuse_inode(entry->d_inode)->i_time = | 71 | get_fuse_inode(entry->d_inode)->i_time = |
| 41 | time_to_jiffies(o->attr_valid, o->attr_valid_nsec); | 72 | time_to_jiffies(o->attr_valid, o->attr_valid_nsec); |
| @@ -47,7 +78,7 @@ static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o) | |||
| 47 | */ | 78 | */ |
| 48 | void fuse_invalidate_attr(struct inode *inode) | 79 | void fuse_invalidate_attr(struct inode *inode) |
| 49 | { | 80 | { |
| 50 | get_fuse_inode(inode)->i_time = jiffies - 1; | 81 | get_fuse_inode(inode)->i_time = 0; |
| 51 | } | 82 | } |
| 52 | 83 | ||
| 53 | /* | 84 | /* |
| @@ -60,7 +91,7 @@ void fuse_invalidate_attr(struct inode *inode) | |||
| 60 | */ | 91 | */ |
| 61 | static void fuse_invalidate_entry_cache(struct dentry *entry) | 92 | static void fuse_invalidate_entry_cache(struct dentry *entry) |
| 62 | { | 93 | { |
| 63 | entry->d_time = jiffies - 1; | 94 | fuse_dentry_settime(entry, 0); |
| 64 | } | 95 | } |
| 65 | 96 | ||
| 66 | /* | 97 | /* |
| @@ -102,7 +133,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) | |||
| 102 | 133 | ||
| 103 | if (inode && is_bad_inode(inode)) | 134 | if (inode && is_bad_inode(inode)) |
| 104 | return 0; | 135 | return 0; |
| 105 | else if (time_after(jiffies, entry->d_time)) { | 136 | else if (fuse_dentry_time(entry) < get_jiffies_64()) { |
| 106 | int err; | 137 | int err; |
| 107 | struct fuse_entry_out outarg; | 138 | struct fuse_entry_out outarg; |
| 108 | struct fuse_conn *fc; | 139 | struct fuse_conn *fc; |
| @@ -666,7 +697,7 @@ static int fuse_revalidate(struct dentry *entry) | |||
| 666 | if (!fuse_allow_task(fc, current)) | 697 | if (!fuse_allow_task(fc, current)) |
| 667 | return -EACCES; | 698 | return -EACCES; |
| 668 | if (get_node_id(inode) != FUSE_ROOT_ID && | 699 | if (get_node_id(inode) != FUSE_ROOT_ID && |
| 669 | time_before_eq(jiffies, fi->i_time)) | 700 | fi->i_time >= get_jiffies_64()) |
| 670 | return 0; | 701 | return 0; |
| 671 | 702 | ||
| 672 | return fuse_do_getattr(inode); | 703 | return fuse_do_getattr(inode); |
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 0dbf96621841..69c7750d55b8 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
| @@ -59,7 +59,7 @@ struct fuse_inode { | |||
| 59 | struct fuse_req *forget_req; | 59 | struct fuse_req *forget_req; |
| 60 | 60 | ||
| 61 | /** Time in jiffies until the file attributes are valid */ | 61 | /** Time in jiffies until the file attributes are valid */ |
| 62 | unsigned long i_time; | 62 | u64 i_time; |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | /** FUSE specific file data */ | 65 | /** FUSE specific file data */ |
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index dcaaabd3b9c4..7d25092262ae 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
| @@ -51,7 +51,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) | |||
| 51 | return NULL; | 51 | return NULL; |
| 52 | 52 | ||
| 53 | fi = get_fuse_inode(inode); | 53 | fi = get_fuse_inode(inode); |
| 54 | fi->i_time = jiffies - 1; | 54 | fi->i_time = 0; |
| 55 | fi->nodeid = 0; | 55 | fi->nodeid = 0; |
| 56 | fi->nlookup = 0; | 56 | fi->nlookup = 0; |
| 57 | fi->forget_req = fuse_request_alloc(); | 57 | fi->forget_req = fuse_request_alloc(); |
diff --git a/fs/inotify_user.c b/fs/inotify_user.c index f2386442adee..017cb0f134d6 100644 --- a/fs/inotify_user.c +++ b/fs/inotify_user.c | |||
| @@ -187,7 +187,7 @@ static struct inotify_kernel_event * kernel_event(s32 wd, u32 mask, u32 cookie, | |||
| 187 | { | 187 | { |
| 188 | struct inotify_kernel_event *kevent; | 188 | struct inotify_kernel_event *kevent; |
| 189 | 189 | ||
| 190 | kevent = kmem_cache_alloc(event_cachep, GFP_KERNEL); | 190 | kevent = kmem_cache_alloc(event_cachep, GFP_NOFS); |
| 191 | if (unlikely(!kevent)) | 191 | if (unlikely(!kevent)) |
| 192 | return NULL; | 192 | return NULL; |
| 193 | 193 | ||
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index ecc439d2565f..501d83884530 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
| @@ -187,6 +187,11 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
| 187 | goto out; | 187 | goto out; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | /* Set user creds for this exportpoint */ | ||
| 191 | error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
| 192 | if (error) | ||
| 193 | goto out; | ||
| 194 | |||
| 190 | /* | 195 | /* |
| 191 | * Look up the dentry using the NFS file handle. | 196 | * Look up the dentry using the NFS file handle. |
| 192 | */ | 197 | */ |
| @@ -241,16 +246,17 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
| 241 | dprintk("nfsd: fh_verify - just checking\n"); | 246 | dprintk("nfsd: fh_verify - just checking\n"); |
| 242 | dentry = fhp->fh_dentry; | 247 | dentry = fhp->fh_dentry; |
| 243 | exp = fhp->fh_export; | 248 | exp = fhp->fh_export; |
| 249 | /* Set user creds for this exportpoint; necessary even | ||
| 250 | * in the "just checking" case because this may be a | ||
| 251 | * filehandle that was created by fh_compose, and that | ||
| 252 | * is about to be used in another nfsv4 compound | ||
| 253 | * operation */ | ||
| 254 | error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
| 255 | if (error) | ||
| 256 | goto out; | ||
| 244 | } | 257 | } |
| 245 | cache_get(&exp->h); | 258 | cache_get(&exp->h); |
| 246 | 259 | ||
| 247 | /* Set user creds for this exportpoint; necessary even in the "just | ||
| 248 | * checking" case because this may be a filehandle that was created by | ||
| 249 | * fh_compose, and that is about to be used in another nfsv4 compound | ||
| 250 | * operation */ | ||
| 251 | error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
| 252 | if (error) | ||
| 253 | goto out; | ||
| 254 | 260 | ||
| 255 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); | 261 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); |
| 256 | if (error) | 262 | if (error) |
diff --git a/fs/partitions/Kconfig b/fs/partitions/Kconfig index c9a478099281..e478f1941831 100644 --- a/fs/partitions/Kconfig +++ b/fs/partitions/Kconfig | |||
| @@ -99,7 +99,7 @@ config IBM_PARTITION | |||
| 99 | 99 | ||
| 100 | config MAC_PARTITION | 100 | config MAC_PARTITION |
| 101 | bool "Macintosh partition map support" if PARTITION_ADVANCED | 101 | bool "Macintosh partition map support" if PARTITION_ADVANCED |
| 102 | default y if MAC | 102 | default y if (MAC || PPC_PMAC) |
| 103 | help | 103 | help |
| 104 | Say Y here if you would like to use hard disks under Linux which | 104 | Say Y here if you would like to use hard disks under Linux which |
| 105 | were partitioned on a Macintosh. | 105 | were partitioned on a Macintosh. |
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index abd5f23a426d..d344b411e261 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c | |||
| @@ -129,7 +129,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry, | |||
| 129 | struct inode * inode; | 129 | struct inode * inode; |
| 130 | 130 | ||
| 131 | if (l > sb->s_blocksize) | 131 | if (l > sb->s_blocksize) |
| 132 | goto out; | 132 | goto out_notlocked; |
| 133 | 133 | ||
| 134 | lock_kernel(); | 134 | lock_kernel(); |
| 135 | inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); | 135 | inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); |
| @@ -155,6 +155,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry, | |||
| 155 | err = ufs_add_nondir(dentry, inode); | 155 | err = ufs_add_nondir(dentry, inode); |
| 156 | out: | 156 | out: |
| 157 | unlock_kernel(); | 157 | unlock_kernel(); |
| 158 | out_notlocked: | ||
| 158 | return err; | 159 | return err; |
| 159 | 160 | ||
| 160 | out_fail: | 161 | out_fail: |
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index ceda3a2859d2..7858703ed84c 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h | |||
| @@ -246,8 +246,8 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *); | |||
| 246 | #define BUF_BUSY XBF_DONT_BLOCK | 246 | #define BUF_BUSY XBF_DONT_BLOCK |
| 247 | 247 | ||
| 248 | #define XFS_BUF_BFLAGS(bp) ((bp)->b_flags) | 248 | #define XFS_BUF_BFLAGS(bp) ((bp)->b_flags) |
| 249 | #define XFS_BUF_ZEROFLAGS(bp) \ | 249 | #define XFS_BUF_ZEROFLAGS(bp) ((bp)->b_flags &= \ |
| 250 | ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI)) | 250 | ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI|XBF_ORDERED)) |
| 251 | 251 | ||
| 252 | #define XFS_BUF_STALE(bp) ((bp)->b_flags |= XFS_B_STALE) | 252 | #define XFS_BUF_STALE(bp) ((bp)->b_flags |= XFS_B_STALE) |
| 253 | #define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XFS_B_STALE) | 253 | #define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XFS_B_STALE) |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 9bdef9d51900..4754f342a5d3 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
| @@ -314,6 +314,13 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp) | |||
| 314 | return; | 314 | return; |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | if (xfs_readonly_buftarg(mp->m_ddev_targp)) { | ||
| 318 | xfs_fs_cmn_err(CE_NOTE, mp, | ||
| 319 | "Disabling barriers, underlying device is readonly"); | ||
| 320 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
| 321 | return; | ||
| 322 | } | ||
| 323 | |||
| 317 | error = xfs_barrier_test(mp); | 324 | error = xfs_barrier_test(mp); |
| 318 | if (error) { | 325 | if (error) { |
| 319 | xfs_fs_cmn_err(CE_NOTE, mp, | 326 | xfs_fs_cmn_err(CE_NOTE, mp, |
diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/quota/xfs_qm_bhv.c index e95e99f7168f..f137856c3261 100644 --- a/fs/xfs/quota/xfs_qm_bhv.c +++ b/fs/xfs/quota/xfs_qm_bhv.c | |||
| @@ -217,17 +217,24 @@ xfs_qm_statvfs( | |||
| 217 | return 0; | 217 | return 0; |
| 218 | dp = &dqp->q_core; | 218 | dp = &dqp->q_core; |
| 219 | 219 | ||
| 220 | limit = dp->d_blk_softlimit ? dp->d_blk_softlimit : dp->d_blk_hardlimit; | 220 | limit = dp->d_blk_softlimit ? |
| 221 | be64_to_cpu(dp->d_blk_softlimit) : | ||
| 222 | be64_to_cpu(dp->d_blk_hardlimit); | ||
| 221 | if (limit && statp->f_blocks > limit) { | 223 | if (limit && statp->f_blocks > limit) { |
| 222 | statp->f_blocks = limit; | 224 | statp->f_blocks = limit; |
| 223 | statp->f_bfree = (statp->f_blocks > dp->d_bcount) ? | 225 | statp->f_bfree = |
| 224 | (statp->f_blocks - dp->d_bcount) : 0; | 226 | (statp->f_blocks > be64_to_cpu(dp->d_bcount)) ? |
| 227 | (statp->f_blocks - be64_to_cpu(dp->d_bcount)) : 0; | ||
| 225 | } | 228 | } |
| 226 | limit = dp->d_ino_softlimit ? dp->d_ino_softlimit : dp->d_ino_hardlimit; | 229 | |
| 230 | limit = dp->d_ino_softlimit ? | ||
| 231 | be64_to_cpu(dp->d_ino_softlimit) : | ||
| 232 | be64_to_cpu(dp->d_ino_hardlimit); | ||
| 227 | if (limit && statp->f_files > limit) { | 233 | if (limit && statp->f_files > limit) { |
| 228 | statp->f_files = limit; | 234 | statp->f_files = limit; |
| 229 | statp->f_ffree = (statp->f_files > dp->d_icount) ? | 235 | statp->f_ffree = |
| 230 | (statp->f_ffree - dp->d_icount) : 0; | 236 | (statp->f_files > be64_to_cpu(dp->d_icount)) ? |
| 237 | (statp->f_ffree - be64_to_cpu(dp->d_icount)) : 0; | ||
| 231 | } | 238 | } |
| 232 | 239 | ||
| 233 | xfs_qm_dqput(dqp); | 240 | xfs_qm_dqput(dqp); |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 86c1bf0bba9e..1f8ecff8553a 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
| @@ -334,10 +334,9 @@ xfs_itobp( | |||
| 334 | #if !defined(__KERNEL__) | 334 | #if !defined(__KERNEL__) |
| 335 | ni = 0; | 335 | ni = 0; |
| 336 | #elif defined(DEBUG) | 336 | #elif defined(DEBUG) |
| 337 | ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 : | 337 | ni = BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog; |
| 338 | (BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog); | ||
| 339 | #else /* usual case */ | 338 | #else /* usual case */ |
| 340 | ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 : 1; | 339 | ni = 1; |
| 341 | #endif | 340 | #endif |
| 342 | 341 | ||
| 343 | for (i = 0; i < ni; i++) { | 342 | for (i = 0; i < ni; i++) { |
| @@ -348,11 +347,15 @@ xfs_itobp( | |||
| 348 | (i << mp->m_sb.sb_inodelog)); | 347 | (i << mp->m_sb.sb_inodelog)); |
| 349 | di_ok = INT_GET(dip->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC && | 348 | di_ok = INT_GET(dip->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC && |
| 350 | XFS_DINODE_GOOD_VERSION(INT_GET(dip->di_core.di_version, ARCH_CONVERT)); | 349 | XFS_DINODE_GOOD_VERSION(INT_GET(dip->di_core.di_version, ARCH_CONVERT)); |
| 351 | if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP, | 350 | if (unlikely(XFS_TEST_ERROR(!di_ok, mp, |
| 352 | XFS_RANDOM_ITOBP_INOTOBP))) { | 351 | XFS_ERRTAG_ITOBP_INOTOBP, |
| 352 | XFS_RANDOM_ITOBP_INOTOBP))) { | ||
| 353 | if (imap_flags & XFS_IMAP_BULKSTAT) { | ||
| 354 | xfs_trans_brelse(tp, bp); | ||
| 355 | return XFS_ERROR(EINVAL); | ||
| 356 | } | ||
| 353 | #ifdef DEBUG | 357 | #ifdef DEBUG |
| 354 | if (!(imap_flags & XFS_IMAP_BULKSTAT)) | 358 | cmn_err(CE_ALERT, |
| 355 | cmn_err(CE_ALERT, | ||
| 356 | "Device %s - bad inode magic/vsn " | 359 | "Device %s - bad inode magic/vsn " |
| 357 | "daddr %lld #%d (magic=%x)", | 360 | "daddr %lld #%d (magic=%x)", |
| 358 | XFS_BUFTARG_NAME(mp->m_ddev_targp), | 361 | XFS_BUFTARG_NAME(mp->m_ddev_targp), |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index e730328636c3..21ac1a67e3e0 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
| @@ -1413,7 +1413,7 @@ xlog_sync(xlog_t *log, | |||
| 1413 | ops = iclog->ic_header.h_num_logops; | 1413 | ops = iclog->ic_header.h_num_logops; |
| 1414 | INT_SET(iclog->ic_header.h_num_logops, ARCH_CONVERT, ops); | 1414 | INT_SET(iclog->ic_header.h_num_logops, ARCH_CONVERT, ops); |
| 1415 | 1415 | ||
| 1416 | bp = iclog->ic_bp; | 1416 | bp = iclog->ic_bp; |
| 1417 | ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == (unsigned long)1); | 1417 | ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == (unsigned long)1); |
| 1418 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2); | 1418 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2); |
| 1419 | XFS_BUF_SET_ADDR(bp, BLOCK_LSN(INT_GET(iclog->ic_header.h_lsn, ARCH_CONVERT))); | 1419 | XFS_BUF_SET_ADDR(bp, BLOCK_LSN(INT_GET(iclog->ic_header.h_lsn, ARCH_CONVERT))); |
| @@ -1430,15 +1430,14 @@ xlog_sync(xlog_t *log, | |||
| 1430 | } | 1430 | } |
| 1431 | XFS_BUF_SET_PTR(bp, (xfs_caddr_t) &(iclog->ic_header), count); | 1431 | XFS_BUF_SET_PTR(bp, (xfs_caddr_t) &(iclog->ic_header), count); |
| 1432 | XFS_BUF_SET_FSPRIVATE(bp, iclog); /* save for later */ | 1432 | XFS_BUF_SET_FSPRIVATE(bp, iclog); /* save for later */ |
| 1433 | XFS_BUF_ZEROFLAGS(bp); | ||
| 1433 | XFS_BUF_BUSY(bp); | 1434 | XFS_BUF_BUSY(bp); |
| 1434 | XFS_BUF_ASYNC(bp); | 1435 | XFS_BUF_ASYNC(bp); |
| 1435 | /* | 1436 | /* |
| 1436 | * Do an ordered write for the log block. | 1437 | * Do an ordered write for the log block. |
| 1437 | * | 1438 | * Its unnecessary to flush the first split block in the log wrap case. |
| 1438 | * It may not be needed to flush the first split block in the log wrap | ||
| 1439 | * case, but do it anyways to be safe -AK | ||
| 1440 | */ | 1439 | */ |
| 1441 | if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) | 1440 | if (!split && (log->l_mp->m_flags & XFS_MOUNT_BARRIER)) |
| 1442 | XFS_BUF_ORDERED(bp); | 1441 | XFS_BUF_ORDERED(bp); |
| 1443 | 1442 | ||
| 1444 | ASSERT(XFS_BUF_ADDR(bp) <= log->l_logBBsize-1); | 1443 | ASSERT(XFS_BUF_ADDR(bp) <= log->l_logBBsize-1); |
| @@ -1460,7 +1459,7 @@ xlog_sync(xlog_t *log, | |||
| 1460 | return error; | 1459 | return error; |
| 1461 | } | 1460 | } |
| 1462 | if (split) { | 1461 | if (split) { |
| 1463 | bp = iclog->ic_log->l_xbuf; | 1462 | bp = iclog->ic_log->l_xbuf; |
| 1464 | ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == | 1463 | ASSERT(XFS_BUF_FSPRIVATE2(bp, unsigned long) == |
| 1465 | (unsigned long)1); | 1464 | (unsigned long)1); |
| 1466 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2); | 1465 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)2); |
| @@ -1468,6 +1467,7 @@ xlog_sync(xlog_t *log, | |||
| 1468 | XFS_BUF_SET_PTR(bp, (xfs_caddr_t)((__psint_t)&(iclog->ic_header)+ | 1467 | XFS_BUF_SET_PTR(bp, (xfs_caddr_t)((__psint_t)&(iclog->ic_header)+ |
| 1469 | (__psint_t)count), split); | 1468 | (__psint_t)count), split); |
| 1470 | XFS_BUF_SET_FSPRIVATE(bp, iclog); | 1469 | XFS_BUF_SET_FSPRIVATE(bp, iclog); |
| 1470 | XFS_BUF_ZEROFLAGS(bp); | ||
| 1471 | XFS_BUF_BUSY(bp); | 1471 | XFS_BUF_BUSY(bp); |
| 1472 | XFS_BUF_ASYNC(bp); | 1472 | XFS_BUF_ASYNC(bp); |
| 1473 | if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) | 1473 | if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) |
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 6c96391f3f1a..b427d220a169 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
| @@ -515,7 +515,7 @@ xfs_mount( | |||
| 515 | if (error) | 515 | if (error) |
| 516 | goto error2; | 516 | goto error2; |
| 517 | 517 | ||
| 518 | if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag & VFS_RDONLY)) | 518 | if (mp->m_flags & XFS_MOUNT_BARRIER) |
| 519 | xfs_mountfs_check_barriers(mp); | 519 | xfs_mountfs_check_barriers(mp); |
| 520 | 520 | ||
| 521 | error = XFS_IOINIT(vfsp, args, flags); | 521 | error = XFS_IOINIT(vfsp, args, flags); |
