diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-02 23:25:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-02 23:25:04 -0400 |
commit | aab174f0df5d72d31caccf281af5f614fa254578 (patch) | |
tree | 2a172c5009c4ac8755e858593154c258ce7709a0 /fs/ocfs2 | |
parent | ca41cc96b2813221b05af57d0355157924de5a07 (diff) | |
parent | 2bd2c1941f141ad780135ccc1cd08ca71a24f10a (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs update from Al Viro:
- big one - consolidation of descriptor-related logics; almost all of
that is moved to fs/file.c
(BTW, I'm seriously tempted to rename the result to fd.c. As it is,
we have a situation when file_table.c is about handling of struct
file and file.c is about handling of descriptor tables; the reasons
are historical - file_table.c used to be about a static array of
struct file we used to have way back).
A lot of stray ends got cleaned up and converted to saner primitives,
disgusting mess in android/binder.c is still disgusting, but at least
doesn't poke so much in descriptor table guts anymore. A bunch of
relatively minor races got fixed in process, plus an ext4 struct file
leak.
- related thing - fget_light() partially unuglified; see fdget() in
there (and yes, it generates the code as good as we used to have).
- also related - bits of Cyrill's procfs stuff that got entangled into
that work; _not_ all of it, just the initial move to fs/proc/fd.c and
switch of fdinfo to seq_file.
- Alex's fs/coredump.c spiltoff - the same story, had been easier to
take that commit than mess with conflicts. The rest is a separate
pile, this was just a mechanical code movement.
- a few misc patches all over the place. Not all for this cycle,
there'll be more (and quite a few currently sit in akpm's tree)."
Fix up trivial conflicts in the android binder driver, and some fairly
simple conflicts due to two different changes to the sock_alloc_file()
interface ("take descriptor handling from sock_alloc_file() to callers"
vs "net: Providing protocol type via system.sockprotoname xattr of
/proc/PID/fd entries" adding a dentry name to the socket)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (72 commits)
MAX_LFS_FILESIZE should be a loff_t
compat: fs: Generic compat_sys_sendfile implementation
fs: push rcu_barrier() from deactivate_locked_super() to filesystems
btrfs: reada_extent doesn't need kref for refcount
coredump: move core dump functionality into its own file
coredump: prevent double-free on an error path in core dumper
usb/gadget: fix misannotations
fcntl: fix misannotations
ceph: don't abuse d_delete() on failure exits
hypfs: ->d_parent is never NULL or negative
vfs: delete surplus inode NULL check
switch simple cases of fget_light to fdget
new helpers: fdget()/fdput()
switch o2hb_region_dev_write() to fget_light()
proc_map_files_readdir(): don't bother with grabbing files
make get_file() return its argument
vhost_set_vring(): turn pollstart/pollstop into bool
switch prctl_set_mm_exe_file() to fget_light()
switch xfs_find_handle() to fget_light()
switch xfs_swapext() to fget_light()
...
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 38 | ||||
-rw-r--r-- | fs/ocfs2/dlmfs/dlmfs.c | 5 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 5 |
3 files changed, 29 insertions, 19 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index a4e855e3690e..f7c648d7d6bf 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -1746,8 +1746,8 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1746 | long fd; | 1746 | long fd; |
1747 | int sectsize; | 1747 | int sectsize; |
1748 | char *p = (char *)page; | 1748 | char *p = (char *)page; |
1749 | struct file *filp = NULL; | 1749 | struct fd f; |
1750 | struct inode *inode = NULL; | 1750 | struct inode *inode; |
1751 | ssize_t ret = -EINVAL; | 1751 | ssize_t ret = -EINVAL; |
1752 | int live_threshold; | 1752 | int live_threshold; |
1753 | 1753 | ||
@@ -1766,26 +1766,26 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1766 | if (fd < 0 || fd >= INT_MAX) | 1766 | if (fd < 0 || fd >= INT_MAX) |
1767 | goto out; | 1767 | goto out; |
1768 | 1768 | ||
1769 | filp = fget(fd); | 1769 | f = fdget(fd); |
1770 | if (filp == NULL) | 1770 | if (f.file == NULL) |
1771 | goto out; | 1771 | goto out; |
1772 | 1772 | ||
1773 | if (reg->hr_blocks == 0 || reg->hr_start_block == 0 || | 1773 | if (reg->hr_blocks == 0 || reg->hr_start_block == 0 || |
1774 | reg->hr_block_bytes == 0) | 1774 | reg->hr_block_bytes == 0) |
1775 | goto out; | 1775 | goto out2; |
1776 | 1776 | ||
1777 | inode = igrab(filp->f_mapping->host); | 1777 | inode = igrab(f.file->f_mapping->host); |
1778 | if (inode == NULL) | 1778 | if (inode == NULL) |
1779 | goto out; | 1779 | goto out2; |
1780 | 1780 | ||
1781 | if (!S_ISBLK(inode->i_mode)) | 1781 | if (!S_ISBLK(inode->i_mode)) |
1782 | goto out; | 1782 | goto out3; |
1783 | 1783 | ||
1784 | reg->hr_bdev = I_BDEV(filp->f_mapping->host); | 1784 | reg->hr_bdev = I_BDEV(f.file->f_mapping->host); |
1785 | ret = blkdev_get(reg->hr_bdev, FMODE_WRITE | FMODE_READ, NULL); | 1785 | ret = blkdev_get(reg->hr_bdev, FMODE_WRITE | FMODE_READ, NULL); |
1786 | if (ret) { | 1786 | if (ret) { |
1787 | reg->hr_bdev = NULL; | 1787 | reg->hr_bdev = NULL; |
1788 | goto out; | 1788 | goto out3; |
1789 | } | 1789 | } |
1790 | inode = NULL; | 1790 | inode = NULL; |
1791 | 1791 | ||
@@ -1797,7 +1797,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1797 | "blocksize %u incorrect for device, expected %d", | 1797 | "blocksize %u incorrect for device, expected %d", |
1798 | reg->hr_block_bytes, sectsize); | 1798 | reg->hr_block_bytes, sectsize); |
1799 | ret = -EINVAL; | 1799 | ret = -EINVAL; |
1800 | goto out; | 1800 | goto out3; |
1801 | } | 1801 | } |
1802 | 1802 | ||
1803 | o2hb_init_region_params(reg); | 1803 | o2hb_init_region_params(reg); |
@@ -1811,13 +1811,13 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1811 | ret = o2hb_map_slot_data(reg); | 1811 | ret = o2hb_map_slot_data(reg); |
1812 | if (ret) { | 1812 | if (ret) { |
1813 | mlog_errno(ret); | 1813 | mlog_errno(ret); |
1814 | goto out; | 1814 | goto out3; |
1815 | } | 1815 | } |
1816 | 1816 | ||
1817 | ret = o2hb_populate_slot_data(reg); | 1817 | ret = o2hb_populate_slot_data(reg); |
1818 | if (ret) { | 1818 | if (ret) { |
1819 | mlog_errno(ret); | 1819 | mlog_errno(ret); |
1820 | goto out; | 1820 | goto out3; |
1821 | } | 1821 | } |
1822 | 1822 | ||
1823 | INIT_DELAYED_WORK(®->hr_write_timeout_work, o2hb_write_timeout); | 1823 | INIT_DELAYED_WORK(®->hr_write_timeout_work, o2hb_write_timeout); |
@@ -1847,7 +1847,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1847 | if (IS_ERR(hb_task)) { | 1847 | if (IS_ERR(hb_task)) { |
1848 | ret = PTR_ERR(hb_task); | 1848 | ret = PTR_ERR(hb_task); |
1849 | mlog_errno(ret); | 1849 | mlog_errno(ret); |
1850 | goto out; | 1850 | goto out3; |
1851 | } | 1851 | } |
1852 | 1852 | ||
1853 | spin_lock(&o2hb_live_lock); | 1853 | spin_lock(&o2hb_live_lock); |
@@ -1863,7 +1863,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1863 | 1863 | ||
1864 | if (reg->hr_aborted_start) { | 1864 | if (reg->hr_aborted_start) { |
1865 | ret = -EIO; | 1865 | ret = -EIO; |
1866 | goto out; | 1866 | goto out3; |
1867 | } | 1867 | } |
1868 | 1868 | ||
1869 | /* Ok, we were woken. Make sure it wasn't by drop_item() */ | 1869 | /* Ok, we were woken. Make sure it wasn't by drop_item() */ |
@@ -1882,11 +1882,11 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1882 | printk(KERN_NOTICE "o2hb: Heartbeat started on region %s (%s)\n", | 1882 | printk(KERN_NOTICE "o2hb: Heartbeat started on region %s (%s)\n", |
1883 | config_item_name(®->hr_item), reg->hr_dev_name); | 1883 | config_item_name(®->hr_item), reg->hr_dev_name); |
1884 | 1884 | ||
1885 | out3: | ||
1886 | iput(inode); | ||
1887 | out2: | ||
1888 | fdput(f); | ||
1885 | out: | 1889 | out: |
1886 | if (filp) | ||
1887 | fput(filp); | ||
1888 | if (inode) | ||
1889 | iput(inode); | ||
1890 | if (ret < 0) { | 1890 | if (ret < 0) { |
1891 | if (reg->hr_bdev) { | 1891 | if (reg->hr_bdev) { |
1892 | blkdev_put(reg->hr_bdev, FMODE_READ|FMODE_WRITE); | 1892 | blkdev_put(reg->hr_bdev, FMODE_READ|FMODE_WRITE); |
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index 83b6f98e0665..16b712d260d4 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c | |||
@@ -691,6 +691,11 @@ static void __exit exit_dlmfs_fs(void) | |||
691 | flush_workqueue(user_dlm_worker); | 691 | flush_workqueue(user_dlm_worker); |
692 | destroy_workqueue(user_dlm_worker); | 692 | destroy_workqueue(user_dlm_worker); |
693 | 693 | ||
694 | /* | ||
695 | * Make sure all delayed rcu free inodes are flushed before we | ||
696 | * destroy cache. | ||
697 | */ | ||
698 | rcu_barrier(); | ||
694 | kmem_cache_destroy(dlmfs_inode_cache); | 699 | kmem_cache_destroy(dlmfs_inode_cache); |
695 | 700 | ||
696 | bdi_destroy(&dlmfs_backing_dev_info); | 701 | bdi_destroy(&dlmfs_backing_dev_info); |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 68f4541c2db9..0e91ec22a940 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1818,6 +1818,11 @@ static int ocfs2_initialize_mem_caches(void) | |||
1818 | 1818 | ||
1819 | static void ocfs2_free_mem_caches(void) | 1819 | static void ocfs2_free_mem_caches(void) |
1820 | { | 1820 | { |
1821 | /* | ||
1822 | * Make sure all delayed rcu free inodes are flushed before we | ||
1823 | * destroy cache. | ||
1824 | */ | ||
1825 | rcu_barrier(); | ||
1821 | if (ocfs2_inode_cachep) | 1826 | if (ocfs2_inode_cachep) |
1822 | kmem_cache_destroy(ocfs2_inode_cachep); | 1827 | kmem_cache_destroy(ocfs2_inode_cachep); |
1823 | ocfs2_inode_cachep = NULL; | 1828 | ocfs2_inode_cachep = NULL; |