summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* fs/sysv/super.c: add support for non-PDP11 v7 filesystemsLubomir Rintel2010-08-111-24/+50
| | | | | | | | | | | | | | This adds byte order autodetection (of PDP-11 and LE filesystems). No attempt is made to detect big-endian filesystems -- were there any? Tested with PDP-11 v7 filesystems and PC-IX maintenance floppy. [akpm@linux-foundation.org: coding-style fixes] [AV: parser.h inclusion was a rudiment of discarded stuff] Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Cc: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* V7: Adjust sanity checks for some volumesLubomir Rintel2010-08-111-2/+4
| | | | | | | | | | | | Newly mkfs-ed filesystems from Seventh Edition have last modification time set to zero, but are otherwise perfectly valid. Also, tighten up other sanity checks to filter out most filesystems with different bytesex than we're using. Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Add v7 aliasLubomir Rintel2010-08-111-0/+1
| | | | | | | | So that the module gets autoloaded when a v7 filesystem is mounted. Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* v9fs: fixup for inode_setattr being removedStephen Rothwell2010-08-111-3/+12
| | | | | Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge git://git.infradead.org/mtd-2.6Linus Torvalds2010-08-1019-3/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.infradead.org/mtd-2.6: (79 commits) mtd: Remove obsolete <mtd/compatmac.h> include mtd: Update copyright notices jffs2: Update copyright notices mtd-physmap: add support users can assign the probe type in board files mtd: remove redwood map driver mxc_nand: Add v3 (i.MX51) Support mxc_nand: support 8bit ecc mxc_nand: fix correct_data function mxc_nand: add V1_V2 namespace to registers mxc_nand: factor out a check_int function mxc_nand: make some internally used functions overwriteable mxc_nand: rework get_dev_status mxc_nand: remove 0xe00 offset from registers mtd: denali: Add multi connected NAND support mtd: denali: Remove set_ecc_config function mtd: denali: Remove unuseful code in get_xx_nand_para functions mtd: denali: Remove device_info_tag structure mtd: m25p80: add support for the Winbond W25Q32 SPI flash chip mtd: m25p80: add support for the Intel/Numonyx {16,32,64}0S33B SPI flash chips mtd: m25p80: add support for the EON EN25P{32, 64} SPI flash chips ... Fix up trivial conflicts in drivers/mtd/maps/{Kconfig,redwood.c} due to redwood driver removal.
| * mtd: Remove obsolete <mtd/compatmac.h> includeDavid Woodhouse2010-08-081-1/+0
| | | | | | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * jffs2: Update copyright noticesDavid Woodhouse2010-08-0818-2/+20
| | | | | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* | Merge branch 'for-linus' of ↵Linus Torvalds2010-08-105-30/+48
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/bcopeland/omfs * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bcopeland/omfs: omfs: fix uninitialized variable warning omfs: sanity check cluster size omfs: refuse to mount if bitmap pointer is obviously wrong omfs: check bounds on block numbers before passing to sb_bread omfs: fix memory leak
| * | omfs: fix uninitialized variable warningBill Pemberton2010-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | quiet the warning: fs/omfs/file.c: In function 'omfs_get_block': fs/omfs/file.c:225: warning: 'new_block' may be used uninitialized in this function new_block is used properly by the call to omfs_grow_extent() Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Bob Copeland <me@bobcopeland.com>
| * | omfs: sanity check cluster sizeBob Copeland2010-07-102-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A corrupt filesystem could have a bad cluster size; this could result in the filesystem allocating too much space for files if too large, or getting stuck in omfs_allocate_block if too small. The proper range is 1-8 blocks. Reported-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Bob Copeland <me@bobcopeland.com>
| * | omfs: refuse to mount if bitmap pointer is obviously wrongBob Copeland2010-07-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | If the free space bitmap pointer is corrupted such that it lies outside of the number of blocks in the filesystem, print a message and fail the mount so the user can fix it offline. Signed-off-by: Bob Copeland <me@bobcopeland.com>
| * | omfs: check bounds on block numbers before passing to sb_breadBob Copeland2010-07-104-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | In case of filesystem corruption, passing unchecked block numbers into sb_bread can result in an infinite loop in __getblk(). Introduce a wrapper function omfs_sbread() to check the block numbers and to also perform the clus_to_blk() scaling. Signed-off-by: Bob Copeland <me@bobcopeland.com>
| * | omfs: fix memory leakDavidlohr Bueso2010-07-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | In the error path of omfs_fill_super(), the FS super block info (sbi) is not being freed. Correct this. Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Bob Copeland <me@bobcopeland.com>
* | | Merge branch 'for-linus' of git://git.infradead.org/users/eparis/notifyLinus Torvalds2010-08-1029-1747/+2468
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-linus' of git://git.infradead.org/users/eparis/notify: (132 commits) fanotify: use both marks when possible fsnotify: pass both the vfsmount mark and inode mark fsnotify: walk the inode and vfsmount lists simultaneously fsnotify: rework ignored mark flushing fsnotify: remove global fsnotify groups lists fsnotify: remove group->mask fsnotify: remove the global masks fsnotify: cleanup should_send_event fanotify: use the mark in handler functions audit: use the mark in handler functions dnotify: use the mark in handler functions inotify: use the mark in handler functions fsnotify: send fsnotify_mark to groups in event handling functions fsnotify: Exchange list heads instead of moving elements fsnotify: srcu to protect read side of inode and vfsmount locks fsnotify: use an explicit flag to indicate fsnotify_destroy_mark has been called fsnotify: use _rcu functions for mark list traversal fsnotify: place marks on object in order of group memory address vfs/fsnotify: fsnotify_close can delay the final work in fput fsnotify: store struct file not struct path ... Fix up trivial delete/modify conflict in fs/notify/inotify/inotify.c.
| * | | fanotify: use both marks when possibleEric Paris2010-07-284-58/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fanotify currently, when given a vfsmount_mark will look up (if it exists) the corresponding inode mark. This patch drops that lookup and uses the mark provided. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: pass both the vfsmount mark and inode markEric Paris2010-07-284-38/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | should_send_event() and handle_event() will both need to look up the inode event if they get a vfsmount event. Lets just pass both at the same time since we have them both after walking the lists in lockstep. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: walk the inode and vfsmount lists simultaneouslyEric Paris2010-07-281-50/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently walk the list of marks on an inode followed by the list of marks on the vfsmount. These are in order (by the memory address of the group) so lets walk them both together. Eventually we can pass both the inode mark and the vfsmount mark to helpers simultaneously. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: rework ignored mark flushingEric Paris2010-07-281-49/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | currently ignored_mark clearing is done in a seperate list traversal before the actual list traversal to send events. There is no need for this. Do them at the same time. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: remove global fsnotify groups listsEric Paris2010-07-284-128/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The global fsnotify groups lists were invented as a way to increase the performance of fsnotify by shortcutting events which were not interesting. With the changes to walk the object lists rather than global groups lists these shortcuts are not useful. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: remove group->maskEric Paris2010-07-284-47/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | group->mask is now useless. It was originally a shortcut for fsnotify to save on performance. These checks are now redundant, so we remove them. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: remove the global masksEric Paris2010-07-283-46/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we walk the object->fsnotify_marks list instead of the global fsnotify groups list we don't need the fsnotify_inode_mask and fsnotify_vfsmount_mask as these were simply shortcuts in fsnotify() for performance. They are now extra checks, rip them out. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: cleanup should_send_eventEric Paris2010-07-284-38/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change to use srcu and walk the object list rather than the global fsnotify_group list means that should_send_event is no longer needed for a number of groups and can be simplified for others. Do that. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fanotify: use the mark in handler functionsEric Paris2010-07-281-29/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fanotify now gets a mark in the should_send_event and handle_event functions. Rather than look up the mark themselves fanotify should just use the mark it was handed. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | dnotify: use the mark in handler functionsEric Paris2010-07-281-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dnotify now gets a mark in the should_send_event and handle_event functions. Rather than look up the mark themselves dnotify should just use the mark it was handed. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | inotify: use the mark in handler functionsEric Paris2010-07-281-24/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inotify now gets a mark in the should_send_event and handle_event functions. Rather than look up the mark themselves inotify should just use the mark it was handed. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: send fsnotify_mark to groups in event handling functionsEric Paris2010-07-284-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the change of fsnotify to use srcu walking the marks list instead of walking the global groups list we now know the mark in question. The code can send the mark to the group's handling functions and the groups won't have to find those marks themselves. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: Exchange list heads instead of moving elementsAndreas Gruenbacher2010-07-281-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of moving list elements from destroy_list to &private_destroy_list, exchange the list heads. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: srcu to protect read side of inode and vfsmount locksEric Paris2010-07-284-40/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently reading the inode->i_fsnotify_marks or vfsmount->mnt_fsnotify_marks lists are protected by a spinlock on both the read and the write side. This patch protects the read side of those lists with a new single srcu. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: use an explicit flag to indicate fsnotify_destroy_mark has been calledEric Paris2010-07-283-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently fsnotify check is mark->group is NULL to decide if fsnotify_destroy_mark() has already been called or not. With the upcoming rcu work it is a heck of a lot easier to use an explicit flag than worry about group being set to NULL. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: use _rcu functions for mark list traversalEric Paris2010-07-282-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for srcu locking use all _rcu appropiete functions for mark list addition, removal, and traversal. The operations are still done under a spinlock at the end of this patch. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: place marks on object in order of group memory addressEric Paris2010-07-282-25/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fsnotify_marks currently are placed on objects (inodes or vfsmounts) in arbitrary order. This patch places them in order of the group memory address. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | vfs/fsnotify: fsnotify_close can delay the final work in fputEric Paris2010-07-282-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fanotify almost works like so: user context calls fsnotify_* function with a struct file. fsnotify takes a reference on the struct path user context goes about it's buissiness at some later point in time the fsnotify listener gets the struct path fanotify listener calls dentry_open() to create a file which userspace can deal with listener drops the reference on the struct path at some later point the listener calls close() on it's new file With the switch from struct path to struct file this presents a problem for fput() and fsnotify_close(). fsnotify_close() is called when the filp has already reached 0 and __fput() wants to do it's cleanup. The solution presented here is a bit odd. If an event is created from a struct file we take a reference on the file. We check however if the f_count was already 0 and if so we take an EXTRA reference EVEN THOUGH IT WAS ZERO. In __fput() (where we know the f_count hit 0 once) we check if the f_count is non-zero and if so we drop that 'extra' ref and return without destroying the file. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: store struct file not struct pathEric Paris2010-07-285-32/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Al explains that calling dentry_open() with a mnt/dentry pair is only garunteed to be safe if they are already used in an open struct file. To make sure this is the case don't store and use a struct path in fsnotify, always use a struct file. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: fsnotify_add_notify_event should return an eventEric Paris2010-07-284-88/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than the horrific void ** argument and such just to pass the fanotify_merge event back to the caller of fsnotify_add_notify_event() have those things return an event if it was different than the event suggusted to be added. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: add pr_debug throughoutEric Paris2010-07-284-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be hard to debug fsnotify since there are so few printks. Use pr_debug to allow for dynamic debugging. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fanotify: groups can specify their f_flags for new fdEric Paris2010-07-281-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently fanotify fds opened for thier listeners are done with f_flags equal to O_RDONLY | O_LARGEFILE. This patch instead takes f_flags from the fanotify_init syscall and uses those when opening files in the context of the listener. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: check to make sure all fsnotify bits are uniqueEric Paris2010-07-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a check to make sure that all fsnotify bits are unique and we cannot accidentally use the same bit for 2 different fsnotify event types. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | inotify: Fix mask checksJerome Marchand2010-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mask checks in inotify_update_existing_watch() and inotify_new_watch() are useless because inotify_arg_to_mask() sets FS_IN_IGNORED and FS_EVENT_ON_CHILD bits anyway. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | inotify: force inotify and fsnotify use same bitsEric Paris2010-07-281-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inotify uses bits called IN_* and fsnotify uses bits called FS_*. These need to line up. This patch adds build time checks to make sure noone can change these bits so they are not the same. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | inotify: allow users to request not to recieve events on unlinked childrenEric Paris2010-07-282-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An inotify watch on a directory will send events for children even if those children have been unlinked. This patch add a new inotify flag IN_EXCL_UNLINK which allows a watch to specificy they don't care about unlinked children. This should fix performance problems seen by tasks which add a watch to /tmp and then are overrun with events when other processes are reading and writing to unlinked files they created in /tmp. https://bugzilla.kernel.org/show_bug.cgi?id=16296 Requested-by: Matthias Clasen <mclasen@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | inotify: send IN_UNMOUNT eventsEric Paris2010-07-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the .31 or so notify rewrite inotify has not sent events about inodes which are unmounted. This patch restores those events. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | inotify: fix inotify oneshot supportEric Paris2010-07-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | During the large inotify rewrite to fsnotify I completely dropped support for IN_ONESHOT. Reimplement that support. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: update gfp/slab.h includesTejun Heo2010-07-282-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implicit slab.h inclusion via percpu.h is about to go away. Make sure gfp.h or slab.h is included as necessary. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Eric Paris <eparis@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fanotify: drop the useless priority argumentEric Paris2010-07-282-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | The priority argument in fanotify is useless. Kill it. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fanotify: default Kconfig to nEric Paris2010-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fanotify has default to y in linux-next since it's inception but default to n in the final push to Linus. Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | inotify_user.c: make local symbol staticH Hartley Sweeten2010-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symbol inotify_max_user_watches is not used outside this file and should be static. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: John McCutchan <john@johnmccutchan.com> Cc: Robert Love <rlove@rlove.org> Cc: Eric Paris <eparis@parisplace.org> Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fsnotify: call iput on inodes when no longer markedEric Paris2010-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsnotify takes an igrab on an inode when it adds a mark. The code was supposed to drop the reference when the mark was removed but didn't. This caused problems when an fs was unmounted because those inodes would clearly not be gone. Thus resulting in the most devistating of messages: VFS: Busy inodes after unmount of loop0. Self-destruct in 5 seconds. >>> Have a nice day... Jiri Slaby bisected the problem to a patch in the fsnotify tree. The code snippets below show my stupidity quite clearly. void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark) { ... mark->inode = NULL; ... } void fsnotify_destroy_mark(struct fsnotify_mark *mark) { struct inode *inode = NULL; ... if (mark->flags & FSNOTIFY_MARK_FLAG_INODE) { fsnotify_destroy_inode_mark(mark); inode = mark->i.inode; } ... if (inode) iput(inode); ... } Obviously the intent was to capture the inode before it was set to NULL in fsnotify_destory_inode_mark() so we wouldn't be leaking inodes forever. Instead we leaked them (and exploded on umount) Reported-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fanotify: do not always return 0 in fsnotifyJean-Christophe Dubois2010-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems to me you are always returning 0 in fsnotify, when you should return the error (EPERM) returned by fanotify. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fanotify: do not return 0 in a void functionEric Paris2010-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove_access_response() is supposed to have a void return, but was returning 0; Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Eric Paris <eparis@redhat.com>
| * | | fanotify: userspace interface for permission responsesEric Paris2010-07-282-6/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fanotify groups need to respond to events which include permissions types. To do so groups will send a response using write() on the fanotify_fd they have open. Signed-off-by: Eric Paris <eparis@redhat.com>
OpenPOWER on IntegriCloud