Skip to content

Commit 1dc51b8

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
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 ...
2 parents 9b284cb + 0f1db7d commit 1dc51b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+784
-553
lines changed

Documentation/filesystems/caching/backend-api.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,29 @@ FS-Cache provides some utilities that a cache backend may make use of:
676676
as possible.
677677

678678

679+
(*) Indicate that a stale object was found and discarded:
680+
681+
void fscache_object_retrying_stale(struct fscache_object *object);
682+
683+
This is called to indicate that the lookup procedure found an object in
684+
the cache that the netfs decided was stale. The object has been
685+
discarded from the cache and the lookup will be performed again.
686+
687+
688+
(*) Indicate that the caching backend killed an object:
689+
690+
void fscache_object_mark_killed(struct fscache_object *object,
691+
enum fscache_why_object_killed why);
692+
693+
This is called to indicate that the cache backend preemptively killed an
694+
object. The why parameter should be set to indicate the reason:
695+
696+
FSCACHE_OBJECT_IS_STALE - the object was stale and needs discarding.
697+
FSCACHE_OBJECT_NO_SPACE - there was insufficient cache space
698+
FSCACHE_OBJECT_WAS_RETIRED - the object was retired when relinquished.
699+
FSCACHE_OBJECT_WAS_CULLED - the object was culled to make space.
700+
701+
679702
(*) Get and release references on a retrieval record:
680703

681704
void fscache_get_retrieval(struct fscache_retrieval *op);

Documentation/filesystems/caching/fscache.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ proc files.
284284
enq=N Number of times async ops queued for processing
285285
can=N Number of async ops cancelled
286286
rej=N Number of async ops rejected due to object lookup/create failure
287+
ini=N Number of async ops initialised
287288
dfr=N Number of async ops queued for deferred release
288-
rel=N Number of async ops released
289+
rel=N Number of async ops released (should equal ini=N when idle)
289290
gc=N Number of deferred-release async ops garbage collected
290291
CacheOp alo=N Number of in-progress alloc_object() cache ops
291292
luo=N Number of in-progress lookup_object() cache ops
@@ -303,6 +304,10 @@ proc files.
303304
wrp=N Number of in-progress write_page() cache ops
304305
ucp=N Number of in-progress uncache_page() cache ops
305306
dsp=N Number of in-progress dissociate_pages() cache ops
307+
CacheEv nsp=N Number of object lookups/creations rejected due to lack of space
308+
stl=N Number of stale objects deleted
309+
rtr=N Number of objects retired when relinquished
310+
cul=N Number of objects culled
306311

307312

308313
(*) /proc/fs/fscache/histogram

Documentation/filesystems/dax.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ Usage
1818
-----
1919

2020
If you have a block device which supports DAX, you can make a filesystem
21-
on it as usual. When mounting it, use the -o dax option manually
22-
or add 'dax' to the options in /etc/fstab.
21+
on it as usual. The DAX code currently only supports files with a block
22+
size equal to your kernel's PAGE_SIZE, so you may need to specify a block
23+
size when creating the filesystem. When mounting it, use the "-o dax"
24+
option on the command line or add 'dax' to the options in /etc/fstab.
2325

2426

2527
Implementation Tips for Block Driver Writers

Documentation/filesystems/porting

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,3 +500,7 @@ in your dentry operations instead.
500500
dentry, it does not get nameidata at all and it gets called only when cookie
501501
is non-NULL. Note that link body isn't available anymore, so if you need it,
502502
store it as cookie.
503+
--
504+
[mandatory]
505+
__fd_install() & fd_install() can now sleep. Callers should not
506+
hold a spinlock or other resources that do not allow a schedule.

arch/arc/kernel/troubleshoot.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,12 @@ static void print_task_path_n_nm(struct task_struct *tsk, char *buf)
7171
mmput(mm);
7272

7373
if (exe_file) {
74-
path = exe_file->f_path;
75-
path_get(&exe_file->f_path);
74+
path_nm = file_path(exe_file, buf, 255);
7675
fput(exe_file);
77-
path_nm = d_path(&path, buf, 255);
78-
path_put(&path);
7976
}
8077

8178
done:
82-
pr_info("Path: %s\n", path_nm);
79+
pr_info("Path: %s\n", !IS_ERR(path_nm) ? path_nm : "?");
8380
}
8481

8582
static void show_faulting_vma(unsigned long address, char *buf)
@@ -103,8 +100,7 @@ static void show_faulting_vma(unsigned long address, char *buf)
103100
if (vma && (vma->vm_start <= address)) {
104101
struct file *file = vma->vm_file;
105102
if (file) {
106-
struct path *path = &file->f_path;
107-
nm = d_path(path, buf, PAGE_SIZE - 1);
103+
nm = file_path(file, buf, PAGE_SIZE - 1);
108104
inode = file_inode(vma->vm_file);
109105
dev = inode->i_sb->s_dev;
110106
ino = inode->i_ino;

arch/blackfin/kernel/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void decode_address(char *buf, unsigned long address)
136136
struct file *file = vma->vm_file;
137137

138138
if (file) {
139-
char *d_name = d_path(&file->f_path, _tmpbuf,
139+
char *d_name = file_path(file, _tmpbuf,
140140
sizeof(_tmpbuf));
141141
if (!IS_ERR(d_name))
142142
name = d_name;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static void spufs_prune_dir(struct dentry *dir)
166166
mutex_lock(&d_inode(dir)->i_mutex);
167167
list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
168168
spin_lock(&dentry->d_lock);
169-
if (!(d_unhashed(dentry)) && d_really_is_positive(dentry)) {
169+
if (simple_positive(dentry)) {
170170
dget_dlock(dentry);
171171
__d_drop(dentry);
172172
spin_unlock(&dentry->d_lock);

arch/s390/hypfs/inode.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,13 @@ static void hypfs_add_dentry(struct dentry *dentry)
6262
hypfs_last_dentry = dentry;
6363
}
6464

65-
static inline int hypfs_positive(struct dentry *dentry)
66-
{
67-
return d_really_is_positive(dentry) && !d_unhashed(dentry);
68-
}
69-
7065
static void hypfs_remove(struct dentry *dentry)
7166
{
7267
struct dentry *parent;
7368

7469
parent = dentry->d_parent;
7570
mutex_lock(&d_inode(parent)->i_mutex);
76-
if (hypfs_positive(dentry)) {
71+
if (simple_positive(dentry)) {
7772
if (d_is_dir(dentry))
7873
simple_rmdir(d_inode(parent), dentry);
7974
else

arch/tile/kernel/stack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static void describe_addr(struct KBacktraceIterator *kbt,
332332
}
333333

334334
if (vma->vm_file) {
335-
p = d_path(&vma->vm_file->f_path, buf, bufsize);
335+
p = file_path(vma->vm_file, buf, bufsize);
336336
if (IS_ERR(p))
337337
p = "?";
338338
name = kbasename(p);

arch/tile/mm/elf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int notify_exec(struct mm_struct *mm)
5656
if (exe_file == NULL)
5757
goto done_free;
5858

59-
path = d_path(&exe_file->f_path, buf, PAGE_SIZE);
59+
path = file_path(exe_file, buf, PAGE_SIZE);
6060
if (IS_ERR(path))
6161
goto done_put;
6262

0 commit comments

Comments
 (0)