aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-01 13:26:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-01 13:26:23 -0400
commita0e881b7c189fa2bd76c024dbff91e79511c971d (patch)
tree0c801918565b08921d21aceee5b326f64d998f5f /drivers/usb
parenteff0d13f3823f35d70228cd151d2a2c89288ff32 (diff)
parentdbc6e0222d79e78925fe20733844a796a4b72cf9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull second vfs pile from Al Viro: "The stuff in there: fsfreeze deadlock fixes by Jan (essentially, the deadlock reproduced by xfstests 068), symlink and hardlink restriction patches, plus assorted cleanups and fixes. Note that another fsfreeze deadlock (emergency thaw one) is *not* dealt with - the series by Fernando conflicts a lot with Jan's, breaks userland ABI (FIFREEZE semantics gets changed) and trades the deadlock for massive vfsmount leak; this is going to be handled next cycle. There probably will be another pull request, but that stuff won't be in it." Fix up trivial conflicts due to unrelated changes next to each other in drivers/{staging/gdm72xx/usb_boot.c, usb/gadget/storage_common.c} * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (54 commits) delousing target_core_file a bit Documentation: Correct s_umount state for freeze_fs/unfreeze_fs fs: Remove old freezing mechanism ext2: Implement freezing btrfs: Convert to new freezing mechanism nilfs2: Convert to new freezing mechanism ntfs: Convert to new freezing mechanism fuse: Convert to new freezing mechanism gfs2: Convert to new freezing mechanism ocfs2: Convert to new freezing mechanism xfs: Convert to new freezing code ext4: Convert to new freezing mechanism fs: Protect write paths by sb_start_write - sb_end_write fs: Skip atime update on frozen filesystem fs: Add freezing handling to mnt_want_write() / mnt_drop_write() fs: Improve filesystem freezing handling switch the protection of percpu_counter list to spinlock nfsd: Push mnt_want_write() outside of i_mutex btrfs: Push mnt_want_write() outside of i_mutex fat: Push mnt_want_write() outside of i_mutex ...
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/storage_common.c12
-rw-r--r--drivers/usb/gadget/u_uac1.c6
2 files changed, 8 insertions, 10 deletions
diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c
index ae8b18869b8..8d9bcd8207c 100644
--- a/drivers/usb/gadget/storage_common.c
+++ b/drivers/usb/gadget/storage_common.c
@@ -656,9 +656,8 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
656 if (!(filp->f_mode & FMODE_WRITE)) 656 if (!(filp->f_mode & FMODE_WRITE))
657 ro = 1; 657 ro = 1;
658 658
659 if (filp->f_path.dentry) 659 inode = filp->f_path.dentry->d_inode;
660 inode = filp->f_path.dentry->d_inode; 660 if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
661 if (!inode || (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
662 LINFO(curlun, "invalid file type: %s\n", filename); 661 LINFO(curlun, "invalid file type: %s\n", filename);
663 goto out; 662 goto out;
664 } 663 }
@@ -667,7 +666,7 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
667 * If we can't read the file, it's no good. 666 * If we can't read the file, it's no good.
668 * If we can't write the file, use it read-only. 667 * If we can't write the file, use it read-only.
669 */ 668 */
670 if (!filp->f_op || !(filp->f_op->read || filp->f_op->aio_read)) { 669 if (!(filp->f_op->read || filp->f_op->aio_read)) {
671 LINFO(curlun, "file not readable: %s\n", filename); 670 LINFO(curlun, "file not readable: %s\n", filename);
672 goto out; 671 goto out;
673 } 672 }
@@ -712,7 +711,6 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
712 if (fsg_lun_is_open(curlun)) 711 if (fsg_lun_is_open(curlun))
713 fsg_lun_close(curlun); 712 fsg_lun_close(curlun);
714 713
715 get_file(filp);
716 curlun->blksize = blksize; 714 curlun->blksize = blksize;
717 curlun->blkbits = blkbits; 715 curlun->blkbits = blkbits;
718 curlun->ro = ro; 716 curlun->ro = ro;
@@ -720,10 +718,10 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
720 curlun->file_length = size; 718 curlun->file_length = size;
721 curlun->num_sectors = num_sectors; 719 curlun->num_sectors = num_sectors;
722 LDBG(curlun, "open backing file: %s\n", filename); 720 LDBG(curlun, "open backing file: %s\n", filename);
723 rc = 0; 721 return 0;
724 722
725out: 723out:
726 filp_close(filp, current->files); 724 fput(filp);
727 return rc; 725 return rc;
728} 726}
729 727
diff --git a/drivers/usb/gadget/u_uac1.c b/drivers/usb/gadget/u_uac1.c
index af989898205..e0c5e88e03e 100644
--- a/drivers/usb/gadget/u_uac1.c
+++ b/drivers/usb/gadget/u_uac1.c
@@ -275,17 +275,17 @@ static int gaudio_close_snd_dev(struct gaudio *gau)
275 /* Close control device */ 275 /* Close control device */
276 snd = &gau->control; 276 snd = &gau->control;
277 if (snd->filp) 277 if (snd->filp)
278 filp_close(snd->filp, current->files); 278 filp_close(snd->filp, NULL);
279 279
280 /* Close PCM playback device and setup substream */ 280 /* Close PCM playback device and setup substream */
281 snd = &gau->playback; 281 snd = &gau->playback;
282 if (snd->filp) 282 if (snd->filp)
283 filp_close(snd->filp, current->files); 283 filp_close(snd->filp, NULL);
284 284
285 /* Close PCM capture device and setup substream */ 285 /* Close PCM capture device and setup substream */
286 snd = &gau->capture; 286 snd = &gau->capture;
287 if (snd->filp) 287 if (snd->filp)
288 filp_close(snd->filp, current->files); 288 filp_close(snd->filp, NULL);
289 289
290 return 0; 290 return 0;
291} 291}