projects/linux·commit 1dc51b82

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

1dc51b82 · Linus Torvalds <[email protected]> · 2015-07-04 19:36:06 -07:00

Pull more vfs updates from Al Viro:
 "Assorted VFS fixes and related cleanups (IMO the most interesting in
  that part are f_path-related things and Eric's descriptor-related
  stuff).  UFS regression fixes (it got broken last cycle).  9P fixes.
  fs-cache series, DAX patches, Jan's file_remove_suid() work"

[ I'd say this is much more than "fixes and related cleanups".  The
  file_table locking rule change by Eric Dumazet is a rather big and
  fundamental update even if the patch isn't huge.   - Linus ]

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (49 commits)
  9p: cope with bogus responses from server in p9_client_{read,write}
  p9_client_write(): avoid double p9_free_req()
  9p: forgetting to cancel request on interrupted zero-copy RPC
  dax: bdev_direct_access() may sleep
  block: Add support for DAX reads/writes to block devices
  dax: Use copy_from_iter_nocache
  dax: Add block size note to documentation
  fs/file.c: __fget() and dup2() atomicity rules
  fs/file.c: don't acquire files->file_lock in fd_install()
  fs:super:get_anon_bdev: fix race condition could cause dev exceed its upper limitation
  vfs: avoid creation of inode number 0 in get_next_ino
  namei: make set_root_rcu() return void
  make simple_positive() public
  ufs: use dir_pages instead of ufs_dir_pages()
  pagemap.h: move dir_pages() over there
  remove the pointless include of lglock.h
  fs: cleanup slight list_entry abuse
  xfs: Correctly lock inode when removing suid and file capabilities
  fs: Call security_ops->inode_killpriv on truncate
  fs: Provide function telling whether file_remove_privs() will do anything
  ...
Commit
1dc51b8288007753ad7cd7d08bb8fa930fc8bb10
Parents
9b284cbd · 0f1db7de

Merge commit. Changes below are compared with the first parent: 9b284cbd.

Changes

99 files changed · +784 −553

FileStatusAddDelContent
Documentation/filesystems/caching/backend-api.txtmodified+23−0View file
Documentation/filesystems/caching/fscache.txtmodified+6−1View file
Documentation/filesystems/dax.txtmodified+4−2View file
Documentation/filesystems/portingmodified+4−0View file
arch/arc/kernel/troubleshoot.cmodified+3−7View file
arch/blackfin/kernel/trace.cmodified+1−1View file
arch/powerpc/platforms/cell/spufs/inode.cmodified+1−1View file
arch/s390/hypfs/inode.cmodified+1−6View file
arch/tile/kernel/stack.cmodified+1−1View file
arch/tile/mm/elf.cmodified+1−1View file
drivers/block/drbd/drbd_debugfs.cmodified+1−9View file
drivers/block/loop.cmodified+1−1View file
drivers/infiniband/hw/ipath/ipath_fs.cmodified+1−1View file
drivers/infiniband/hw/qib/qib_fs.cmodified+1−1View file
drivers/md/bitmap.cmodified+2−2View file
drivers/md/md.cmodified+1−1View file
drivers/usb/gadget/function/f_mass_storage.cmodified+1−1View file
drivers/usb/gadget/function/storage_common.cmodified+1−1View file
fs/affs/affs.hmodified+1−1View file
fs/autofs4/autofs_i.hmodified+0−5View file
fs/befs/befs.hmodified+1−1View file
fs/binfmt_elf.cmodified+2−2View file
fs/block_dev.cmodified+10−0View file
fs/btrfs/file.cmodified+1−1View file
fs/cachefiles/internal.hmodified+0−1View file
fs/cachefiles/namei.cmodified+21−12View file
fs/ceph/file.cmodified+1−1View file
fs/coda/coda_linux.hmodified+1−1View file
fs/configfs/inode.cmodified+1−1View file
fs/coredump.cmodified+1−1View file
fs/dax.cmodified+5−3View file
fs/dcache.cmodified+4−1View file
fs/debugfs/inode.cmodified+3−8View file
fs/exofs/dir.cmodified+0−6View file
fs/ext2/dir.cmodified+0−5View file
fs/ext4/super.cmodified+1−1View file
fs/file.cmodified+56−21View file
fs/file_table.cmodified+0−1View file
fs/freevxfs/vxfs_lookup.cmodified+0−7View file
fs/fscache/cookie.cmodified+4−4View file
fs/fscache/internal.hmodified+8−4View file
fs/fscache/object.cmodified+65−4View file
fs/fscache/operation.cmodified+168−86View file
fs/fscache/page.cmodified+43−43View file
fs/fscache/stats.cmodified+13−1View file
fs/fuse/file.cmodified+1−1View file
fs/hfs/hfs_fs.hmodified+1−1View file
fs/hfsplus/hfsplus_fs.hmodified+1−1View file
fs/hpfs/hpfs_fn.hmodified+1−1View file
fs/inode.cmodified+46−20View file
fs/internal.hmodified+1−0View file
fs/jffs2/os-linux.hmodified+1−1View file
fs/jfs/jfs_incore.hmodified+1−1View file
fs/libfs.cmodified+0−5View file
fs/minix/dir.cmodified+0−5View file
fs/minix/minix.hmodified+1−1View file
fs/namei.cmodified+3−3View file
fs/ncpfs/dir.cmodified+2−0View file
fs/nfs/dir.cmodified+1−1View file
fs/nilfs2/dir.cmodified+0−5View file
fs/nilfs2/inode.cmodified+2−20View file
fs/ntfs/file.cmodified+1−1View file
fs/ntfs/inode.hmodified+1−1View file
fs/open.cmodified+36−25View file
fs/overlayfs/inode.cmodified+7−15View file
fs/overlayfs/overlayfs.hmodified+1−0View file
fs/overlayfs/super.cmodified+1−0View file
fs/posix_acl.cmodified+20−26View file
fs/proc/nommu.cmodified+1−1View file
fs/proc/task_mmu.cmodified+2−2View file
fs/proc/task_nommu.cmodified+1−1View file
fs/qnx6/dir.cmodified+0−5View file
fs/seq_file.cmodified+14−0View file
fs/squashfs/squashfs_fs_i.hmodified+1−1View file
fs/super.cmodified+1−1View file
fs/sysv/dir.cmodified+0−5View file
fs/sysv/sysv.hmodified+1−1View file
fs/tracefs/inode.cmodified+3−8View file
fs/udf/udf_i.hmodified+1−1View file
fs/ufs/balloc.cmodified+17−17View file
fs/ufs/dir.cmodified+8−11View file
fs/ufs/ialloc.cmodified+8−8View file
fs/ufs/inode.cmodified+4−1View file
fs/ufs/namei.cmodified+33−46View file
fs/ufs/super.cmodified+11−0View file
fs/ufs/ufs.hmodified+2−1View file
fs/xfs/xfs_file.cmodified+10−1View file
include/linux/dcache.hmodified+7−0View file
include/linux/fdtable.hmodified+3−0View file
include/linux/fs.hmodified+8−3View file
include/linux/fscache-cache.hmodified+27−28View file
include/linux/pagemap.hmodified+6−0View file
include/linux/seq_file.hmodified+1−0View file
kernel/events/core.cmodified+1−1View file
mm/filemap.cmodified+1−1View file
mm/memory.cmodified+1−1View file
mm/swapfile.cmodified+1−1View file
net/9p/client.cmodified+11−1View file
security/inode.cmodified+6−13View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/filesystems/caching/backend-api.txt

View file
diff --git a/Documentation/filesystems/caching/backend-api.txt b/Documentation/filesystems/caching/backend-api.txt
index 277d1e8..c0bd567 100644
--- a/Documentation/filesystems/caching/backend-api.txt
+++ b/Documentation/filesystems/caching/backend-api.txt
@@ -676,6 +676,29 @@ FS-Cache provides some utilities that a cache backend may make use of:
as possible.
+ (*) Indicate that a stale object was found and discarded:
+
+ void fscache_object_retrying_stale(struct fscache_object *object);
+
+ This is called to indicate that the lookup procedure found an object in
+ the cache that the netfs decided was stale. The object has been
+ discarded from the cache and the lookup will be performed again.
+
+
+ (*) Indicate that the caching backend killed an object:
+
+ void fscache_object_mark_killed(struct fscache_object *object,
+ enum fscache_why_object_killed why);
+
+ This is called to indicate that the cache backend preemptively killed an
+ object. The why parameter should be set to indicate the reason:
+
+ FSCACHE_OBJECT_IS_STALE - the object was stale and needs discarding.
+ FSCACHE_OBJECT_NO_SPACE - there was insufficient cache space
+ FSCACHE_OBJECT_WAS_RETIRED - the object was retired when relinquished.
+ FSCACHE_OBJECT_WAS_CULLED - the object was culled to make space.
+
+
(*) Get and release references on a retrieval record:
void fscache_get_retrieval(struct fscache_retrieval *op);

Documentation/filesystems/caching/fscache.txt

View file
diff --git a/Documentation/filesystems/caching/fscache.txt b/Documentation/filesystems/caching/fscache.txt
index 770267a..50f0a57 100644
--- a/Documentation/filesystems/caching/fscache.txt
+++ b/Documentation/filesystems/caching/fscache.txt
@@ -284,8 +284,9 @@ proc files.
enq=N Number of times async ops queued for processing
can=N Number of async ops cancelled
rej=N Number of async ops rejected due to object lookup/create failure
+ ini=N Number of async ops initialised
dfr=N Number of async ops queued for deferred release
- rel=N Number of async ops released
+ rel=N Number of async ops released (should equal ini=N when idle)
gc=N Number of deferred-release async ops garbage collected
CacheOp alo=N Number of in-progress alloc_object() cache ops
luo=N Number of in-progress lookup_object() cache ops
@@ -303,6 +304,10 @@ proc files.
wrp=N Number of in-progress write_page() cache ops
ucp=N Number of in-progress uncache_page() cache ops
dsp=N Number of in-progress dissociate_pages() cache ops
+ CacheEv nsp=N Number of object lookups/creations rejected due to lack of space
+ stl=N Number of stale objects deleted
+ rtr=N Number of objects retired when relinquished
+ cul=N Number of objects culled
(*) /proc/fs/fscache/histogram

Documentation/filesystems/dax.txt

View file
diff --git a/Documentation/filesystems/dax.txt b/Documentation/filesystems/dax.txt
index baf4111..7af2851 100644
--- a/Documentation/filesystems/dax.txt
+++ b/Documentation/filesystems/dax.txt
@@ -18,8 +18,10 @@ Usage
-----
If you have a block device which supports DAX, you can make a filesystem
-on it as usual. When mounting it, use the -o dax option manually
-or add 'dax' to the options in /etc/fstab.
+on it as usual. The DAX code currently only supports files with a block
+size equal to your kernel's PAGE_SIZE, so you may need to specify a block
+size when creating the filesystem. When mounting it, use the "-o dax"
+option on the command line or add 'dax' to the options in /etc/fstab.
Implementation Tips for Block Driver Writers

Documentation/filesystems/porting

View file
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index 68f1c91..f24d1b8 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -500,3 +500,7 @@ in your dentry operations instead.
dentry, it does not get nameidata at all and it gets called only when cookie
is non-NULL. Note that link body isn't available anymore, so if you need it,
store it as cookie.
+--
+[mandatory]
+ __fd_install() & fd_install() can now sleep. Callers should not
+ hold a spinlock or other resources that do not allow a schedule.

arch/arc/kernel/troubleshoot.c

View file
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c
index e0cf998..807f7d6 100644
--- a/arch/arc/kernel/troubleshoot.c
+++ b/arch/arc/kernel/troubleshoot.c
@@ -71,15 +71,12 @@ static void print_task_path_n_nm(struct task_struct *tsk, char *buf)
mmput(mm);
if (exe_file) {
- path = exe_file->f_path;
- path_get(&exe_file->f_path);
+ path_nm = file_path(exe_file, buf, 255);
fput(exe_file);
- path_nm = d_path(&path, buf, 255);
- path_put(&path);
}
done:
- pr_info("Path: %s\n", path_nm);
+ pr_info("Path: %s\n", !IS_ERR(path_nm) ? path_nm : "?");
}
static void show_faulting_vma(unsigned long address, char *buf)
@@ -103,8 +100,7 @@ static void show_faulting_vma(unsigned long address, char *buf)
if (vma && (vma->vm_start <= address)) {
struct file *file = vma->vm_file;
if (file) {
- struct path *path = &file->f_path;
- nm = d_path(path, buf, PAGE_SIZE - 1);
+ nm = file_path(file, buf, PAGE_SIZE - 1);
inode = file_inode(vma->vm_file);
dev = inode->i_sb->s_dev;
ino = inode->i_ino;

arch/blackfin/kernel/trace.c

View file
diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin/kernel/trace.c
index c36efa0..719dd79 100644
--- a/arch/blackfin/kernel/trace.c
+++ b/arch/blackfin/kernel/trace.c
@@ -136,7 +136,7 @@ void decode_address(char *buf, unsigned long address)
struct file *file = vma->vm_file;
if (file) {
- char *d_name = d_path(&file->f_path, _tmpbuf,
+ char *d_name = file_path(file, _tmpbuf,
sizeof(_tmpbuf));
if (!IS_ERR(d_name))
name = d_name;

arch/powerpc/platforms/cell/spufs/inode.c

View file
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 1ba6307..11634fa 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -166,7 +166,7 @@ static void spufs_prune_dir(struct dentry *dir)
mutex_lock(&d_inode(dir)->i_mutex);
list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
spin_lock(&dentry->d_lock);
- if (!(d_unhashed(dentry)) && d_really_is_positive(dentry)) {
+ if (simple_positive(dentry)) {
dget_dlock(dentry);
__d_drop(dentry);
spin_unlock(&dentry->d_lock);

arch/s390/hypfs/inode.c

View file
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 2eeb0a0..b2e5902 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -62,18 +62,13 @@ static void hypfs_add_dentry(struct dentry *dentry)
hypfs_last_dentry = dentry;
}
-static inline int hypfs_positive(struct dentry *dentry)
-{
- return d_really_is_positive(dentry) && !d_unhashed(dentry);
-}
-
static void hypfs_remove(struct dentry *dentry)
{
struct dentry *parent;
parent = dentry->d_parent;
mutex_lock(&d_inode(parent)->i_mutex);
- if (hypfs_positive(dentry)) {
+ if (simple_positive(dentry)) {
if (d_is_dir(dentry))
simple_rmdir(d_inode(parent), dentry);
else

arch/tile/kernel/stack.c

View file
diff --git a/arch/tile/kernel/stack.c b/arch/tile/kernel/stack.c
index 35d3463..402b9c8 100644
--- a/arch/tile/kernel/stack.c
+++ b/arch/tile/kernel/stack.c
@@ -332,7 +332,7 @@ static void describe_addr(struct KBacktraceIterator *kbt,
}
if (vma->vm_file) {
- p = d_path(&vma->vm_file->f_path, buf, bufsize);
+ p = file_path(vma->vm_file, buf, bufsize);
if (IS_ERR(p))
p = "?";
name = kbasename(p);

arch/tile/mm/elf.c

View file
diff --git a/arch/tile/mm/elf.c b/arch/tile/mm/elf.c
index f7ddae3..6225cc9 100644
--- a/arch/tile/mm/elf.c
+++ b/arch/tile/mm/elf.c
@@ -56,7 +56,7 @@ static int notify_exec(struct mm_struct *mm)
if (exe_file == NULL)
goto done_free;
- path = d_path(&exe_file->f_path, buf, PAGE_SIZE);
+ path = file_path(exe_file, buf, PAGE_SIZE);
if (IS_ERR(path))
goto done_put;

drivers/block/drbd/drbd_debugfs.c

View file
diff --git a/drivers/block/drbd/drbd_debugfs.c b/drivers/block/drbd/drbd_debugfs.c
index a6ee3d7..6b88a35 100644
--- a/drivers/block/drbd/drbd_debugfs.c
+++ b/drivers/block/drbd/drbd_debugfs.c
@@ -419,14 +419,6 @@ static int in_flight_summary_show(struct seq_file *m, void *pos)
return 0;
}
-/* simple_positive(file->f_path.dentry) respectively debugfs_positive(),
- * but neither is "reachable" from here.
- * So we have our own inline version of it above. :-( */
-static inline int debugfs_positive(struct dentry *dentry)
-{
- return d_really_is_positive(dentry) && !d_unhashed(dentry);
-}
-
/* make sure at *open* time that the respective object won't go away. */
static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, void *),
void *data, struct kref *kref,
@@ -444,7 +436,7 @@ static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, vo
/* serialize with d_delete() */
mutex_lock(&d_inode(parent)->i_mutex);
/* Make sure the object is still alive */
- if (debugfs_positive(file->f_path.dentry)
+ if (simple_positive(file->f_path.dentry)
&& kref_get_unless_zero(kref))
ret = 0;
mutex_unlock(&d_inode(parent)->i_mutex);

drivers/block/loop.c

View file
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 40580dc..f7a4c9d 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -588,7 +588,7 @@ static ssize_t loop_attr_backing_file_show(struct loop_device *lo, char *buf)
spin_lock_irq(&lo->lo_lock);
if (lo->lo_backing_file)
- p = d_path(&lo->lo_backing_file->f_path, buf, PAGE_SIZE - 1);
+ p = file_path(lo->lo_backing_file, buf, PAGE_SIZE - 1);
spin_unlock_irq(&lo->lo_lock);
if (IS_ERR_OR_NULL(p))

drivers/infiniband/hw/ipath/ipath_fs.c

View file
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index 1ca8e32..25422a3 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -277,7 +277,7 @@ static int remove_file(struct dentry *parent, char *name)
}
spin_lock(&tmp->d_lock);
- if (!d_unhashed(tmp) && d_really_is_positive(tmp)) {
+ if (simple_positive(tmp)) {
dget_dlock(tmp);
__d_drop(tmp);
spin_unlock(&tmp->d_lock);

drivers/infiniband/hw/qib/qib_fs.c

View file
diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
index bdd5d38..13ef22b 100644
--- a/drivers/infiniband/hw/qib/qib_fs.c
+++ b/drivers/infiniband/hw/qib/qib_fs.c
@@ -455,7 +455,7 @@ static int remove_file(struct dentry *parent, char *name)
}
spin_lock(&tmp->d_lock);
- if (!d_unhashed(tmp) && d_really_is_positive(tmp)) {
+ if (simple_positive(tmp)) {
__d_drop(tmp);
spin_unlock(&tmp->d_lock);
simple_unlink(d_inode(parent), tmp);

drivers/md/bitmap.c

View file
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 135a090..ed2346d 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -839,7 +839,7 @@ static void bitmap_file_kick(struct bitmap *bitmap)
if (bitmap->storage.file) {
path = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (path)
- ptr = d_path(&bitmap->storage.file->f_path,
+ ptr = file_path(bitmap->storage.file,
path, PAGE_SIZE);
printk(KERN_ALERT
@@ -1927,7 +1927,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
chunk_kb ? "KB" : "B");
if (bitmap->storage.file) {
seq_printf(seq, ", file: ");
- seq_path(seq, &bitmap->storage.file->f_path, " \t\n");
+ seq_file_path(seq, bitmap->storage.file, " \t\n");
}
seq_printf(seq, "\n");

drivers/md/md.c

View file
diff --git a/drivers/md/md.c b/drivers/md/md.c
index df92d30..d429c30 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5766,7 +5766,7 @@ static int get_bitmap_file(struct mddev *mddev, void __user * arg)
/* bitmap disabled, zero the first byte and copy out */
if (!mddev->bitmap_info.file)
file->pathname[0] = '\0';
- else if ((ptr = d_path(&mddev->bitmap_info.file->f_path,
+ else if ((ptr = file_path(mddev->bitmap_info.file,
file->pathname, sizeof(file->pathname))),
IS_ERR(ptr))
err = PTR_ERR(ptr);

drivers/usb/gadget/function/f_mass_storage.c

View file
diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index 3cc109f..d2259c6 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -2936,7 +2936,7 @@ int fsg_common_create_lun(struct fsg_common *common, struct fsg_lun_config *cfg,
if (fsg_lun_is_open(lun)) {
p = "(error)";
if (pathbuf) {
- p = d_path(&lun->filp->f_path, pathbuf, PATH_MAX);
+ p = file_path(lun->filp, pathbuf, PATH_MAX);
if (IS_ERR(p))
p = "(error)";
}

drivers/usb/gadget/function/storage_common.c

View file
diff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c
index 648f9e4..d626830 100644
--- a/drivers/usb/gadget/function/storage_common.c
+++ b/drivers/usb/gadget/function/storage_common.c
@@ -341,7 +341,7 @@ ssize_t fsg_show_file(struct fsg_lun *curlun, struct rw_semaphore *filesem,
down_read(filesem);
if (fsg_lun_is_open(curlun)) { /* Get the complete pathname */
- p = d_path(&curlun->filp->f_path, buf, PAGE_SIZE - 1);
+ p = file_path(curlun->filp, buf, PAGE_SIZE - 1);
if (IS_ERR(p))
rc = PTR_ERR(p);
else {

fs/affs/affs.h

View file
diff --git a/fs/affs/affs.h b/fs/affs/affs.h
index cffe837..c69a87e 100644
--- a/fs/affs/affs.h
+++ b/fs/affs/affs.h
@@ -64,7 +64,7 @@ struct affs_inode_info {
/* short cut to get to the affs specific inode data */
static inline struct affs_inode_info *AFFS_I(struct inode *inode)
{
- return list_entry(inode, struct affs_inode_info, vfs_inode);
+ return container_of(inode, struct affs_inode_info, vfs_inode);
}
/*

fs/autofs4/autofs_i.h

View file
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 5b700ef..c37149b 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -238,11 +238,6 @@ static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
return d_inode(sbi->sb->s_root)->i_ino;
}
-static inline int simple_positive(struct dentry *dentry)
-{
- return d_really_is_positive(dentry) && !d_unhashed(dentry);
-}
-
static inline void __autofs4_add_expiring(struct dentry *dentry)
{
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);

fs/befs/befs.h

View file
diff --git a/fs/befs/befs.h b/fs/befs/befs.h
index 1fead8d..35d19e8 100644
--- a/fs/befs/befs.h
+++ b/fs/befs/befs.h
@@ -112,7 +112,7 @@ BEFS_SB(const struct super_block *super)
static inline struct befs_inode_info *
BEFS_I(const struct inode *inode)
{
- return list_entry(inode, struct befs_inode_info, vfs_inode);
+ return container_of(inode, struct befs_inode_info, vfs_inode);
}
static inline befs_blocknr_t

fs/binfmt_elf.c

View file
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index cd46e41..6b65996 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1530,7 +1530,7 @@ static int fill_files_note(struct memelfnote *note)
file = vma->vm_file;
if (!file)
continue;
- filename = d_path(&file->f_path, name_curpos, remaining);
+ filename = file_path(file, name_curpos, remaining);
if (IS_ERR(filename)) {
if (PTR_ERR(filename) == -ENAMETOOLONG) {
vfree(data);
@@ -1540,7 +1540,7 @@ static int fill_files_note(struct memelfnote *note)
continue;
}
- /* d_path() fills at the end, move name down */
+ /* file_path() fills at the end, move name down */
/* n = strlen(filename) + 1: */
n = (name_curpos + remaining) - filename;
remaining = filename - name_curpos;

fs/block_dev.c

View file
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 4fe10f9..1982437 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -152,6 +152,9 @@ blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
+ if (IS_DAX(inode))
+ return dax_do_io(iocb, inode, iter, offset, blkdev_get_block,
+ NULL, DIO_SKIP_DIO_COUNT);
return __blockdev_direct_IO(iocb, inode, I_BDEV(inode), iter, offset,
blkdev_get_block, NULL, NULL,
DIO_SKIP_DIO_COUNT);
@@ -443,6 +446,12 @@ long bdev_direct_access(struct block_device *bdev, sector_t sector,
long avail;
const struct block_device_operations *ops = bdev->bd_disk->fops;
+ /*
+ * The device driver is allowed to sleep, in order to make the
+ * memory directly accessible.
+ */
+ might_sleep();
+
if (size < 0)
return size;
if (!ops->direct_access)
@@ -1170,6 +1179,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
bdev->bd_disk = disk;
bdev->bd_queue = disk->queue;
bdev->bd_contains = bdev;
+ bdev->bd_inode->i_flags = disk->fops->direct_access ? S_DAX : 0;
if (!partno) {
ret = -ENXIO;
bdev->bd_part = disk_get_part(disk, partno);

fs/btrfs/file.c

View file
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 795d754..b823fac 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1748,7 +1748,7 @@ static ssize_t btrfs_file_write_iter(struct kiocb *iocb,
}
current->backing_dev_info = inode_to_bdi(inode);
- err = file_remove_suid(file);
+ err = file_remove_privs(file);
if (err) {
mutex_unlock(&inode->i_mutex);
goto out;

fs/cachefiles/internal.h

View file
diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h
index 8c52472..aecd085 100644
--- a/fs/cachefiles/internal.h
+++ b/fs/cachefiles/internal.h
@@ -43,7 +43,6 @@ struct cachefiles_object {
loff_t i_size; /* object size */
unsigned long flags;
#define CACHEFILES_OBJECT_ACTIVE 0 /* T if marked active */
-#define CACHEFILES_OBJECT_BURIED 1 /* T if preemptively buried */
atomic_t usage; /* object usage count */
uint8_t type; /* object type */
uint8_t new; /* T if object new */

fs/cachefiles/namei.c

View file
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index ab857ab..fc1056f 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -97,7 +97,8 @@ static noinline void cachefiles_printk_object(struct cachefiles_object *object,
* call vfs_unlink(), vfs_rmdir() or vfs_rename()
*/
static void cachefiles_mark_object_buried(struct cachefiles_cache *cache,
- struct dentry *dentry)
+ struct dentry *dentry,
+ enum fscache_why_object_killed why)
{
struct cachefiles_object *object;
struct rb_node *p;
@@ -132,8 +133,9 @@ found_dentry:
pr_err("\n");
pr_err("Error: Can't preemptively bury live object\n");
cachefiles_printk_object(object, NULL);
- } else if (test_and_set_bit(CACHEFILES_OBJECT_BURIED, &object->flags)) {
- pr_err("Error: Object already preemptively buried\n");
+ } else {
+ if (why != FSCACHE_OBJECT_IS_STALE)
+ fscache_object_mark_killed(&object->fscache, why);
}
write_unlock(&cache->active_lock);
@@ -265,7 +267,8 @@ requeue:
static int cachefiles_bury_object(struct cachefiles_cache *cache,
struct dentry *dir,
struct dentry *rep,
- bool preemptive)
+ bool preemptive,
+ enum fscache_why_object_killed why)
{
struct dentry *grave, *trap;
struct path path, path_to_graveyard;
@@ -289,7 +292,7 @@ static int cachefiles_bury_object(struct cachefiles_cache *cache,
ret = vfs_unlink(d_inode(dir), rep, NULL);
if (preemptive)
- cachefiles_mark_object_buried(cache, rep);
+ cachefiles_mark_object_buried(cache, rep, why);
}
mutex_unlock(&d_inode(dir)->i_mutex);
@@ -394,7 +397,7 @@ try_again:
"Rename failed with error %d", ret);
if (preemptive)
- cachefiles_mark_object_buried(cache, rep);
+ cachefiles_mark_object_buried(cache, rep, why);
}
unlock_rename(cache->graveyard, dir);
@@ -422,7 +425,7 @@ int cachefiles_delete_object(struct cachefiles_cache *cache,
mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT);
- if (test_bit(CACHEFILES_OBJECT_BURIED, &object->flags)) {
+ if (test_bit(FSCACHE_OBJECT_KILLED_BY_CACHE, &object->fscache.flags)) {
/* object allocation for the same key preemptively deleted this
* object's file so that it could create its own file */
_debug("object preemptively buried");
@@ -433,7 +436,8 @@ int cachefiles_delete_object(struct cachefiles_cache *cache,
* may have been renamed */
if (dir == object->dentry->d_parent) {
ret = cachefiles_bury_object(cache, dir,
- object->dentry, false);
+ object->dentry, false,
+ FSCACHE_OBJECT_WAS_RETIRED);
} else {
/* it got moved, presumably by cachefilesd culling it,
* so it's no longer in the key path and we can ignore
@@ -522,7 +526,7 @@ lookup_again:
if (d_is_negative(next)) {
ret = cachefiles_has_space(cache, 1, 0);
if (ret < 0)
- goto create_error;
+ goto no_space_error;
path.dentry = dir;
ret = security_path_mkdir(&path, next, 0);
@@ -551,7 +555,7 @@ lookup_again:
if (d_is_negative(next)) {
ret = cachefiles_has_space(cache, 1, 0);
if (ret < 0)
- goto create_error;
+ goto no_space_error;
path.dentry = dir;
ret = security_path_mknod(&path, next, S_IFREG, 0);
@@ -602,7 +606,8 @@ lookup_again:
* mutex) */
object->dentry = NULL;
- ret = cachefiles_bury_object(cache, dir, next, true);
+ ret = cachefiles_bury_object(cache, dir, next, true,
+ FSCACHE_OBJECT_IS_STALE);
dput(next);
next = NULL;
@@ -610,6 +615,7 @@ lookup_again:
goto delete_error;
_debug("redo lookup");
+ fscache_object_retrying_stale(&object->fscache);
goto lookup_again;
}
}
@@ -662,6 +668,8 @@ lookup_again:
_leave(" = 0 [%lu]", d_backing_inode(object->dentry)->i_ino);
return 0;
+no_space_error:
+ fscache_object_mark_killed(&object->fscache, FSCACHE_OBJECT_NO_SPACE);
create_error:
_debug("create error %d", ret);
if (ret == -EIO)
@@ -927,7 +935,8 @@ int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir,
/* actually remove the victim (drops the dir mutex) */
_debug("bury");
- ret = cachefiles_bury_object(cache, dir, victim, false);
+ ret = cachefiles_bury_object(cache, dir, victim, false,
+ FSCACHE_OBJECT_WAS_CULLED);
if (ret < 0)
goto error;

fs/ceph/file.c

View file
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index faf9209..8b79d87 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -962,7 +962,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
pos = iocb->ki_pos;
count = iov_iter_count(from);
- err = file_remove_suid(file);
+ err = file_remove_privs(file);
if (err)
goto out;

fs/coda/coda_linux.h

View file
diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h
index d6f7a76..f829fe9 100644
--- a/fs/coda/coda_linux.h
+++ b/fs/coda/coda_linux.h
@@ -79,7 +79,7 @@ void coda_sysctl_clean(void);
static inline struct coda_inode_info *ITOC(struct inode *inode)
{
- return list_entry(inode, struct coda_inode_info, vfs_inode);
+ return container_of(inode, struct coda_inode_info, vfs_inode);

This diff is incomplete. Download the complete patch.

fs/configfs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/coredump.c

View file

This diff is incomplete. Download the complete patch.

fs/dax.c

View file

This diff is incomplete. Download the complete patch.

fs/dcache.c

View file

This diff is incomplete. Download the complete patch.

fs/debugfs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/exofs/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/ext2/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/ext4/super.c

View file

This diff is incomplete. Download the complete patch.

fs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/file_table.c

View file

This diff is incomplete. Download the complete patch.

fs/freevxfs/vxfs_lookup.c

View file

This diff is incomplete. Download the complete patch.

fs/fscache/cookie.c

View file

This diff is incomplete. Download the complete patch.

fs/fscache/internal.h

View file

This diff is incomplete. Download the complete patch.

fs/fscache/object.c

View file

This diff is incomplete. Download the complete patch.

fs/fscache/operation.c

View file

This diff is incomplete. Download the complete patch.

fs/fscache/page.c

View file

This diff is incomplete. Download the complete patch.

fs/fscache/stats.c

View file

This diff is incomplete. Download the complete patch.

fs/fuse/file.c

View file

This diff is incomplete. Download the complete patch.

fs/hfs/hfs_fs.h

View file

This diff is incomplete. Download the complete patch.

fs/hfsplus/hfsplus_fs.h

View file

This diff is incomplete. Download the complete patch.

fs/hpfs/hpfs_fn.h

View file

This diff is incomplete. Download the complete patch.

fs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/internal.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/os-linux.h

View file

This diff is incomplete. Download the complete patch.

fs/jfs/jfs_incore.h

View file

This diff is incomplete. Download the complete patch.

fs/libfs.c

View file

This diff is incomplete. Download the complete patch.

fs/minix/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/minix/minix.h

View file

This diff is incomplete. Download the complete patch.

fs/namei.c

View file

This diff is incomplete. Download the complete patch.

fs/ncpfs/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/nfs/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/nilfs2/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/nilfs2/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/ntfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/ntfs/inode.h

View file

This diff is incomplete. Download the complete patch.

fs/open.c

View file

This diff is incomplete. Download the complete patch.

fs/overlayfs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/overlayfs/overlayfs.h

View file

This diff is incomplete. Download the complete patch.

fs/overlayfs/super.c

View file

This diff is incomplete. Download the complete patch.

fs/posix_acl.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/nommu.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/task_mmu.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/task_nommu.c

View file

This diff is incomplete. Download the complete patch.

fs/qnx6/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/seq_file.c

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/squashfs_fs_i.h

View file

This diff is incomplete. Download the complete patch.

fs/super.c

View file

This diff is incomplete. Download the complete patch.

fs/sysv/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/sysv/sysv.h

View file

This diff is incomplete. Download the complete patch.

fs/tracefs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/udf/udf_i.h

View file

This diff is incomplete. Download the complete patch.

fs/ufs/balloc.c

View file

This diff is incomplete. Download the complete patch.

fs/ufs/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/ufs/ialloc.c

View file

This diff is incomplete. Download the complete patch.

fs/ufs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/ufs/namei.c

View file

This diff is incomplete. Download the complete patch.

fs/ufs/super.c

View file

This diff is incomplete. Download the complete patch.

fs/ufs/ufs.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_file.c

View file

This diff is incomplete. Download the complete patch.

include/linux/dcache.h

View file

This diff is incomplete. Download the complete patch.

include/linux/fdtable.h

View file

This diff is incomplete. Download the complete patch.

include/linux/fs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/fscache-cache.h

View file

This diff is incomplete. Download the complete patch.

include/linux/pagemap.h

View file

This diff is incomplete. Download the complete patch.

include/linux/seq_file.h

View file

This diff is incomplete. Download the complete patch.

kernel/events/core.c

View file

This diff is incomplete. Download the complete patch.

mm/filemap.c

View file

This diff is incomplete. Download the complete patch.

mm/memory.c

View file

This diff is incomplete. Download the complete patch.

mm/swapfile.c

View file

This diff is incomplete. Download the complete patch.

net/9p/client.c

View file

This diff is incomplete. Download the complete patch.

security/inode.c

View file

This diff is incomplete. Download the complete patch.